mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 02:32:45 +08:00
FIX: not serving non brotli cdns from cdn_url
(this means that access control allow origin could break)
This commit is contained in:
parent
1022535c2b
commit
eaa896d8ee
|
@ -60,6 +60,8 @@ module ApplicationHelper
|
|||
ENV["COMPRESS_BROTLI"] == "1" &&
|
||||
request.env["HTTP_ACCEPT_ENCODING"] =~ /br/
|
||||
path.gsub!("#{GlobalSetting.cdn_url}/assets/", "#{GlobalSetting.cdn_url}/brotli_asset/")
|
||||
elsif GlobalSetting.cdn_url
|
||||
path.gsub!("#{GlobalSetting.cdn_url}/assets/", "#{GlobalSetting.cdn_url}/cdn_asset/")
|
||||
end
|
||||
"<link rel='preload' href='#{path}' as='script'/>
|
||||
<script src='#{path}'></script>".html_safe
|
||||
|
|
Loading…
Reference in New Issue
Block a user