mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: allow using CDN URL for all s3 uploads (#20755)
This adds an option to allow non-image s3 files to be downloaded through CDN URL. Addresses the issues in: * meta.discourse.org/t/s3-cdn-url-not-being-used-on-non-image-uploads/175332 * meta.discourse.org/t/s3-uploads-using-cdn-for-pdfs/213218
This commit is contained in:
@@ -226,6 +226,8 @@ module FileStore
|
||||
force_download: force_download,
|
||||
filename: upload.original_filename,
|
||||
)
|
||||
elsif SiteSetting.s3_use_cdn_url_for_all_uploads
|
||||
cdn_url(upload.url)
|
||||
else
|
||||
upload.url
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user