Skip to content

A platform for community discussion. Free, open, simple.

FIX: use upload's cdn url in composer preview if available.

Vinoth Kannane4fe864c0b7d
diff --git a/lib/pretty_text/helpers.rb b/lib/pretty_text/helpers.rb
index 9c898882a7c..417600469bf 100644
--- a/lib/pretty_text/helpers.rb
+++ b/lib/pretty_text/helpers.rb
@@ -70,7 +70,7 @@ module PrettyText
if short_urls = reverse_map[sha1]
short_urls.each do |short_url|
result[short_url] = {
- url: url,
+ url: Discourse.store.cdn_url(url),
short_path: Upload.short_path(sha1: sha1, extension: extension),
base62_sha1: Upload.base62_sha1(sha1)
}