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

There are some places in the code base that assumes the method should
return nil.
This commit is contained in:
Guo Xiang Tan 2019-05-29 18:36:09 +08:00
parent 5d47d1833b
commit a3938f98f8
2 changed files with 2 additions and 7 deletions

View File

@ -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

View File

@ -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)