mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
FIX: Use CDN for optimized loading images. (#7006)
We missed a few spots in the cooked post processor where images where not loaded using CDN, causing uneeded load and requests against the server
This commit is contained in:
@ -389,7 +389,7 @@ class CookedPostProcessor
|
||||
if upload
|
||||
thumbnail = upload.thumbnail(w, h)
|
||||
if thumbnail && thumbnail.filesize.to_i < upload.filesize
|
||||
img["src"] = thumbnail.url
|
||||
img["src"] = UrlHelper.cook_url(thumbnail.url)
|
||||
|
||||
srcset = +""
|
||||
|
||||
@ -408,11 +408,11 @@ class CookedPostProcessor
|
||||
img["srcset"] = "#{UrlHelper.cook_url(img["src"])}#{srcset}" if srcset.present?
|
||||
end
|
||||
else
|
||||
img["src"] = upload.url
|
||||
img["src"] = UrlHelper.cook_url(upload.url)
|
||||
end
|
||||
|
||||
if small_upload = loading_image(upload)
|
||||
img["data-small-upload"] = small_upload.url
|
||||
img["data-small-upload"] = UrlHelper.cook_url(small_upload.url)
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user