mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
This reverts commit e3de45359f.
We need to improve out strategy by adding a cache breaker with this change ... some assets on CDNs and clients may have incorrect CORS headers which can cause stuff to break.
This commit is contained in:
@@ -737,17 +737,6 @@ RSpec.describe ApplicationController do
|
||||
end
|
||||
end
|
||||
|
||||
context "cdn requests" do
|
||||
before do
|
||||
GlobalSetting.stubs(:cdn_url).returns("https://www.example.com/")
|
||||
end
|
||||
|
||||
it "should block the dynamic routes" do
|
||||
get "/"
|
||||
expect(response.status).to eq(404)
|
||||
end
|
||||
end
|
||||
|
||||
context "set_locale_from_accept_language_header enabled" do
|
||||
context "accept-language header differs from default locale" do
|
||||
before do
|
||||
|
||||
@@ -116,25 +116,6 @@ describe StaticController do
|
||||
File.delete(file_path)
|
||||
end
|
||||
end
|
||||
|
||||
it 'has correct cors headers for brotli assets' do
|
||||
begin
|
||||
assets_path = Rails.root.join("public/assets")
|
||||
|
||||
FileUtils.mkdir_p(assets_path)
|
||||
|
||||
file_path = assets_path.join("test.js.br")
|
||||
File.write(file_path, 'fake brotli file')
|
||||
GlobalSetting.stubs(:cdn_url).returns("https://www.example.com/")
|
||||
|
||||
get "/brotli_asset/test.js"
|
||||
|
||||
expect(response.status).to eq(200)
|
||||
expect(response.headers["Access-Control-Allow-Origin"]).to match("*")
|
||||
ensure
|
||||
File.delete(file_path)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context '#cdn_asset' do
|
||||
|
||||
Reference in New Issue
Block a user