Sha256: c0a481394aaa5a4c90038343bb65502545b7143467a7db951999263eac6c56b4

Contents?: true

Size: 706 Bytes

Versions: 59

Compression:

Stored size: 706 Bytes

Contents

require File.expand_path('../spec_helper.rb', __FILE__)

describe Rack::Protection::XSSHeader do
  it_behaves_like "any rack application"

  it 'should set the X-XSS-Protection' do
    get('/').headers["X-XSS-Protection"].should == "1; mode=block"
  end

  it 'should allow changing the protection mode' do
    # I have no clue what other modes are available
    mock_app do
      use Rack::Protection::XSSHeader, :xss_mode => :foo
      run DummyApp
    end

    get('/').headers["X-XSS-Protection"].should == "1; mode=foo"
  end

  it 'should not override the header if already set' do
    mock_app with_headers("X-XSS-Protection" => "0")
    get('/').headers["X-XSS-Protection"].should == "0"
  end
end

Version data entries

59 entries across 59 versions & 4 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/rack-protection-1.2.0/spec/xss_header_spec.rb
classiccms-0.7.4 vendor/bundle/gems/rack-protection-1.2.0/spec/xss_header_spec.rb
classiccms-0.7.3 vendor/bundle/gems/rack-protection-1.2.0/spec/xss_header_spec.rb
classiccms-0.7.2 vendor/bundle/gems/rack-protection-1.2.0/spec/xss_header_spec.rb
classiccms-0.7.1 vendor/bundle/gems/rack-protection-1.2.0/spec/xss_header_spec.rb
classiccms-0.7.0 vendor/bundle/gems/rack-protection-1.2.0/spec/xss_header_spec.rb
classiccms-0.6.9 vendor/bundle/gems/rack-protection-1.2.0/spec/xss_header_spec.rb
classiccms-0.6.8 vendor/bundle/gems/rack-protection-1.2.0/spec/xss_header_spec.rb
classiccms-0.6.7 vendor/bundle/gems/rack-protection-1.2.0/spec/xss_header_spec.rb
classiccms-0.6.6 vendor/bundle/gems/rack-protection-1.2.0/spec/xss_header_spec.rb
classiccms-0.6.5 vendor/bundle/gems/rack-protection-1.2.0/spec/xss_header_spec.rb
classiccms-0.6.4 vendor/bundle/gems/rack-protection-1.2.0/spec/xss_header_spec.rb
classiccms-0.6.3 vendor/bundle/gems/rack-protection-1.2.0/spec/xss_header_spec.rb
classiccms-0.6.2 vendor/bundle/gems/rack-protection-1.2.0/spec/xss_header_spec.rb
classiccms-0.6.1 vendor/bundle/gems/rack-protection-1.2.0/spec/xss_header_spec.rb
classiccms-0.6.0 vendor/bundle/gems/rack-protection-1.2.0/spec/xss_header_spec.rb
classiccms-0.5.17 vendor/bundle/gems/rack-protection-1.2.0/spec/xss_header_spec.rb
classiccms-0.5.16 vendor/bundle/gems/rack-protection-1.2.0/spec/xss_header_spec.rb
classiccms-0.5.15 vendor/bundle/gems/rack-protection-1.2.0/spec/xss_header_spec.rb
classiccms-0.5.14 vendor/bundle/gems/rack-protection-1.2.0/spec/xss_header_spec.rb