Revert changes to `FileStore::S3Store#path_for` in f0620e7118a76a1faea0ca15ac554818f8bb1bcf.

Revert changes to FileStore::S3Store#path_for in f0620e7118a76a1faea0ca15ac554818f8bb1bcf.

There are some places in the code base that assumes the method should return nil.

diff --git a/app/controllers/uploads_controller.rb b/app/controllers/uploads_controller.rb
index 64852af..73bf3b6 100644
--- a/app/controllers/uploads_controller.rb
+++ b/app/controllers/uploads_controller.rb
@@ -98,7 +98,7 @@ class UploadsController < ApplicationController
       if Discourse.store.internal?
         send_file_local_upload(upload)
       else
-        redirect_to Discourse.store.path_for(upload)
+        redirect_to upload.url
       end
     else
       render_404
diff --git a/lib/file_store/s3_store.rb b/lib/file_store/s3_store.rb
index df3296f..a23ccb2 100644
--- a/lib/file_store/s3_store.rb
+++ b/lib/file_store/s3_store.rb
@@ -102,12 +102,7 @@ module FileStore
 
     def path_for(upload)
       url = upload&.url
-
-      if url && url[/^\/[^\/]/]
-        FileStore::LocalStore.new.path_for(upload)
-      else
-        url
-      end
+      FileStore::LocalStore.new.path_for(upload) if url && url[/^\/[^\/]/]
     end
 
     def cdn_url(url)

GitHub sha: a3938f98

Fix the build a3938f98f8b575675fc9b541725aa224fcddf682.

This commit has been mentioned on Discourse Meta. There might be relevant details there: