FIX: Allow CSP to work correctly for non-default hostnames/schemes (#9180)

- Define the CSP based on the requested domain / scheme (respecting force_https)
- Update EnforceHostname middleware to allow secondary domains, add specs
- Add URL scheme to anon cache key so that CSP headers are cached correctly
This commit is contained in:
David Taylor
2020-03-19 19:54:42 +00:00
committed by GitHub
parent e9a3639b10
commit 19814c5e81
10 changed files with 122 additions and 21 deletions
-2
View File
@@ -2,8 +2,6 @@
require 'rails_helper'
describe ContentSecurityPolicy do
before { ContentSecurityPolicy.base_url = nil }
after do
DiscoursePluginRegistry.reset!
end