From 6c00d5b0c44156e614192285737c274796a7d3f7 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 19 Dec 2023 20:59:28 +0100 Subject: [PATCH] Fix test failure caused by glitch-soc changes --- config/initializers/content_security_policy.rb | 9 +++++---- spec/requests/api/v1/instance_spec.rb | 4 ++-- spec/requests/api/v2/instance_spec.rb | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb index 15e9032807..a2b84433a7 100644 --- a/config/initializers/content_security_policy.rb +++ b/config/initializers/content_security_policy.rb @@ -60,15 +60,11 @@ unless Rails.env.development? p.base_uri :none p.default_src :none p.frame_ancestors :none - p.script_src :self, assets_host, "'wasm-unsafe-eval'" p.font_src :self, assets_host p.img_src :self, :data, :blob, *data_hosts p.style_src :self, assets_host p.media_src :self, :data, *data_hosts p.frame_src :self, :https - p.child_src :self, :blob, assets_host - p.worker_src :self, :blob, assets_host - p.connect_src :self, :blob, :data, Rails.configuration.x.streaming_api_base_url, *data_hosts p.manifest_src :self, assets_host if sso_host.present? @@ -76,6 +72,11 @@ unless Rails.env.development? else p.form_action :self end + + p.child_src :self, :blob, assets_host + p.worker_src :self, :blob, assets_host + p.connect_src :self, :blob, :data, Rails.configuration.x.streaming_api_base_url, *data_hosts + p.script_src :self, assets_host, "'wasm-unsafe-eval'" end end diff --git a/spec/requests/api/v1/instance_spec.rb b/spec/requests/api/v1/instance_spec.rb index 9cac280c4d..600584eccb 100644 --- a/spec/requests/api/v1/instance_spec.rb +++ b/spec/requests/api/v1/instance_spec.rb @@ -17,7 +17,7 @@ describe 'Instances' do expect(body_as_json) .to be_present - .and include(title: 'Mastodon') + .and include(title: 'Mastodon Glitch Edition') end end @@ -30,7 +30,7 @@ describe 'Instances' do expect(body_as_json) .to be_present - .and include(title: 'Mastodon') + .and include(title: 'Mastodon Glitch Edition') end end end diff --git a/spec/requests/api/v2/instance_spec.rb b/spec/requests/api/v2/instance_spec.rb index 74574afbcf..bbe8299ac5 100644 --- a/spec/requests/api/v2/instance_spec.rb +++ b/spec/requests/api/v2/instance_spec.rb @@ -17,7 +17,7 @@ describe 'Instances' do expect(body_as_json) .to be_present - .and include(title: 'Mastodon') + .and include(title: 'Mastodon Glitch Edition') end end @@ -30,7 +30,7 @@ describe 'Instances' do expect(body_as_json) .to be_present - .and include(title: 'Mastodon') + .and include(title: 'Mastodon Glitch Edition') end end end