mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
FIX: redirect to CDN avatar for s3 avatars
This commit is contained in:
parent
0a2a248acc
commit
a988cd5abe
4 changed files with 26 additions and 3 deletions
|
@ -44,6 +44,10 @@ module FileStore
|
|||
def purge_tombstone(grace_period)
|
||||
end
|
||||
|
||||
def cdn_url(url)
|
||||
url
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -79,6 +79,14 @@ module FileStore
|
|||
end
|
||||
end
|
||||
|
||||
def cdn_url(url)
|
||||
if SiteSetting.s3_cdn_url.present?
|
||||
url.sub(absolute_base_url, SiteSetting.s3_cdn_url)
|
||||
else
|
||||
url
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def get_path_for_upload(file, upload)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue