Disable monkey patch for rack-protection

This commit is contained in:
Eloy Pérez 2022-02-05 13:32:44 +01:00
parent 5f95f553ab
commit d53ff943b8
19 changed files with 21 additions and 20 deletions

View File

@ -1,4 +1,4 @@
describe Rack::Protection::AuthenticityToken do
RSpec.describe Rack::Protection::AuthenticityToken do
let(:token) { described_class.random_token }
let(:masked_token) { described_class.token(session) }
let(:bad_token) { Base64.strict_encode64("badtoken") }

View File

@ -1,4 +1,4 @@
describe Rack::Protection::Base do
RSpec.describe Rack::Protection::Base do
subject { described_class.new(lambda {}) }

View File

@ -1,4 +1,4 @@
describe Rack::Protection::ContentSecurityPolicy do
RSpec.describe Rack::Protection::ContentSecurityPolicy do
it_behaves_like "any rack application"
it 'should set the Content Security Policy' do

View File

@ -1,4 +1,4 @@
describe Rack::Protection::CookieTossing do
RSpec.describe Rack::Protection::CookieTossing do
it_behaves_like "any rack application"
context 'with default reaction' do

View File

@ -1,4 +1,4 @@
describe Rack::Protection::EscapedParams do
RSpec.describe Rack::Protection::EscapedParams do
it_behaves_like "any rack application"
context 'escaping' do

View File

@ -1,4 +1,4 @@
describe Rack::Protection::FormToken do
RSpec.describe Rack::Protection::FormToken do
let(:token) { described_class.random_token }
let(:masked_token) { described_class.token(session) }
let(:bad_token) { Base64.strict_encode64("badtoken") }

View File

@ -1,4 +1,4 @@
describe Rack::Protection::FrameOptions do
RSpec.describe Rack::Protection::FrameOptions do
it_behaves_like "any rack application"
it 'should set the X-Frame-Options' do

View File

@ -1,4 +1,4 @@
describe Rack::Protection::HttpOrigin do
RSpec.describe Rack::Protection::HttpOrigin do
it_behaves_like "any rack application"
before(:each) do

View File

@ -1,4 +1,4 @@
describe Rack::Protection::IPSpoofing do
RSpec.describe Rack::Protection::IPSpoofing do
it_behaves_like "any rack application"
it 'accepts requests without X-Forward-For header' do

View File

@ -1,4 +1,4 @@
describe Rack::Protection::JsonCsrf do
RSpec.describe Rack::Protection::JsonCsrf do
it_behaves_like "any rack application"
module DummyAppWithBody

View File

@ -1,4 +1,4 @@
describe Rack::Protection::PathTraversal do
RSpec.describe Rack::Protection::PathTraversal do
it_behaves_like "any rack application"
context 'escaping' do

View File

@ -1,4 +1,4 @@
describe Rack::Protection do
RSpec.describe Rack::Protection do
it_behaves_like "any rack application"
it 'passes on options' do

View File

@ -1,4 +1,4 @@
describe Rack::Protection::RemoteReferrer do
RSpec.describe Rack::Protection::RemoteReferrer do
it_behaves_like "any rack application"
it "accepts post requests with no referrer" do

View File

@ -1,4 +1,4 @@
describe Rack::Protection::RemoteToken do
RSpec.describe Rack::Protection::RemoteToken do
let(:token) { described_class.random_token }
let(:masked_token) { described_class.token(session) }
let(:bad_token) { Base64.strict_encode64("badtoken") }

View File

@ -1,4 +1,4 @@
describe Rack::Protection::SessionHijacking do
RSpec.describe Rack::Protection::SessionHijacking do
it_behaves_like "any rack application"
it "accepts a session without changes to tracked parameters" do

View File

@ -1,4 +1,4 @@
describe Rack::Protection::StrictTransport do
RSpec.describe Rack::Protection::StrictTransport do
it_behaves_like "any rack application"
it 'should set the Strict-Transport-Security header' do

View File

@ -1,4 +1,4 @@
describe Rack::Protection::XSSHeader do
RSpec.describe Rack::Protection::XSSHeader do
it_behaves_like "any rack application"
it 'should set the X-XSS-Protection' do

View File

@ -21,8 +21,9 @@ Dir[File.expand_path('support/**/*.rb', __dir__)].each { |f| require f }
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
RSpec.configure do |config|
# The settings below are suggested to provide a good initial experience
# with RSpec, but feel free to customize to your heart's content.
# The settings below are suggested to provide a good initial experience
# with RSpec, but feel free to customize to your heart's content.
config.disable_monkey_patching!
# These two settings work together to allow you to limit a spec run
# to individual examples or groups you care about by tagging them with

View File

@ -1,4 +1,4 @@
shared_examples_for 'any rack application' do
RSpec.shared_examples_for 'any rack application' do
it "should not interfere with normal get requests" do
expect(get('/')).to be_ok
expect(body).to eq('ok')