mirror of
https://github.com/funamitech/mastodon
synced 2024-12-05 02:09:05 +09:00
660372d130
* Revert "Fix image and media loading when using external storage server" This reverts commit6cfa0245ca
. * Revert "Change glitch-soc's CSP config to match upstream's closer (#2474)" This reverts commitd59196e170
.
28 lines
1.1 KiB
Ruby
28 lines
1.1 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
describe 'Content-Security-Policy' do
|
|
it 'sets the expected CSP headers' do
|
|
allow(SecureRandom).to receive(:base64).with(16).and_return('ZbA+JmE7+bK8F5qvADZHuQ==')
|
|
|
|
get '/'
|
|
expect(response.headers['Content-Security-Policy'].split(';').map(&:strip)).to contain_exactly(
|
|
"base-uri 'none'",
|
|
"default-src 'none'",
|
|
"frame-ancestors 'none'",
|
|
"font-src 'self' https://cb6e6126.ngrok.io",
|
|
"img-src 'self' data: blob: https://cb6e6126.ngrok.io",
|
|
"style-src 'self' https://cb6e6126.ngrok.io 'nonce-ZbA+JmE7+bK8F5qvADZHuQ=='",
|
|
"media-src 'self' data: https://cb6e6126.ngrok.io",
|
|
"frame-src 'self' https:",
|
|
"manifest-src 'self' https://cb6e6126.ngrok.io",
|
|
"form-action 'self'",
|
|
"child-src 'self' blob: https://cb6e6126.ngrok.io",
|
|
"worker-src 'self' blob: https://cb6e6126.ngrok.io",
|
|
"connect-src 'self' blob: data: ws://localhost:4000 https://cb6e6126.ngrok.io",
|
|
"script-src 'self' https://cb6e6126.ngrok.io 'wasm-unsafe-eval'"
|
|
)
|
|
end
|
|
end
|