FIX: GlobalPath#upload_cdn_path when S3 bucket has a folder (#6523)

This commit is contained in:
Kyle Zhao
2018-10-23 23:34:10 -04:00
committed by Sam
parent 5fd94d3211
commit 63356d883e
2 changed files with 13 additions and 1 deletions

View File

@ -9,7 +9,7 @@ module GlobalPath
def upload_cdn_path(p)
if SiteSetting.Upload.s3_cdn_url.present?
p = p.sub(Discourse.store.absolute_base_url, SiteSetting.Upload.s3_cdn_url)
p = Discourse.store.cdn_url(p)
end
p =~ /^http/ ? p : cdn_path(p)
end