Revert "FIX: GlobalPath#upload_cdn_path when S3 bucket has a folder (#6523)"
This reverts commit 63356d883e
.
This caused an outage, got to revert
This commit is contained in:
parent
63356d883e
commit
322b27b6dc
|
@ -9,7 +9,7 @@ module GlobalPath
|
|||
|
||||
def upload_cdn_path(p)
|
||||
if SiteSetting.Upload.s3_cdn_url.present?
|
||||
p = Discourse.store.cdn_url(p)
|
||||
p = p.sub(Discourse.store.absolute_base_url, SiteSetting.Upload.s3_cdn_url)
|
||||
end
|
||||
p =~ /^http/ ? p : cdn_path(p)
|
||||
end
|
||||
|
|
|
@ -25,18 +25,6 @@ describe GlobalPath do
|
|||
GlobalSetting.expects(:cdn_url).returns("https://something.com:221/foo")
|
||||
expect(cdn_relative_path("/test")).to eq("/foo/test")
|
||||
end
|
||||
end
|
||||
|
||||
describe '#upload_cdn_path' do
|
||||
it 'generates correctly when S3 bucket has a folder' do
|
||||
global_setting :s3_access_key_id, 's3_access_key_id'
|
||||
global_setting :s3_secret_access_key, 's3_secret_access_key'
|
||||
global_setting :s3_bucket, 'file-uploads/folder'
|
||||
global_setting :s3_region, 'us-west-2'
|
||||
global_setting :s3_cdn_url, 'https://cdn-aws.com/folder'
|
||||
|
||||
expect(GlobalPathInstance.upload_cdn_path("#{Discourse.store.absolute_base_url}/folder/upload.jpg"))
|
||||
.to eq("https://cdn-aws.com/folder/upload.jpg")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue