DEV: use cdn url to download the external uploads to local.

This commit is contained in:
Vinoth Kannan
2019-06-06 19:17:19 +05:30
parent 4be54d5ae1
commit b7830680b6
2 changed files with 18 additions and 3 deletions

View File

@@ -77,7 +77,8 @@ module FileStore
if !file
max_file_size_kb = [SiteSetting.max_image_size_kb, SiteSetting.max_attachment_size_kb].max.kilobytes
url = SiteSetting.scheme + ":" + upload.url
url = Discourse.store.cdn_url(upload.url)
url = SiteSetting.scheme + ":" + url if url =~ /^\/\//
file = FileHelper.download(
url,
max_file_size: max_file_size_kb,