Sha256: b351f37b8771562d028c5f9c60ecab0c88175ce47c542c9cb524ae9e2c9c7dae

Contents?: true

Size: 895 Bytes

Versions: 59

Compression:

Stored size: 895 Bytes

Contents

require 'rack/protection'

module Rack
  module Protection
    ##
    # Prevented attack::   Clickjacking
    # Supported browsers:: Internet Explorer 8, Firefox 3.6.9, Opera 10.50,
    #                      Safari 4.0, Chrome 4.1.249.1042 and later
    # More infos::         https://developer.mozilla.org/en/The_X-FRAME-OPTIONS_response_header
    #
    # Sets X-Frame-Options header to tell the browser avoid embedding the page
    # in a frame.
    #
    # Options:
    #
    # frame_options:: Defines who should be allowed to embed the page in a
    #                 frame. Use :deny to forbid any embedding, :sameorigin
    #                 to allow embedding from the same origin (default).
    class FrameOptions < XSSHeader
      default_options :frame_options => :sameorigin
      def header
        { 'X-Frame-Options' => options[:frame_options].to_s }
      end
    end
  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/lib/rack/protection/frame_options.rb
classiccms-0.7.4 vendor/bundle/gems/rack-protection-1.2.0/lib/rack/protection/frame_options.rb
classiccms-0.7.3 vendor/bundle/gems/rack-protection-1.2.0/lib/rack/protection/frame_options.rb
classiccms-0.7.2 vendor/bundle/gems/rack-protection-1.2.0/lib/rack/protection/frame_options.rb
classiccms-0.7.1 vendor/bundle/gems/rack-protection-1.2.0/lib/rack/protection/frame_options.rb
classiccms-0.7.0 vendor/bundle/gems/rack-protection-1.2.0/lib/rack/protection/frame_options.rb
classiccms-0.6.9 vendor/bundle/gems/rack-protection-1.2.0/lib/rack/protection/frame_options.rb
classiccms-0.6.8 vendor/bundle/gems/rack-protection-1.2.0/lib/rack/protection/frame_options.rb
classiccms-0.6.7 vendor/bundle/gems/rack-protection-1.2.0/lib/rack/protection/frame_options.rb
classiccms-0.6.6 vendor/bundle/gems/rack-protection-1.2.0/lib/rack/protection/frame_options.rb
classiccms-0.6.5 vendor/bundle/gems/rack-protection-1.2.0/lib/rack/protection/frame_options.rb
classiccms-0.6.4 vendor/bundle/gems/rack-protection-1.2.0/lib/rack/protection/frame_options.rb
classiccms-0.6.3 vendor/bundle/gems/rack-protection-1.2.0/lib/rack/protection/frame_options.rb
classiccms-0.6.2 vendor/bundle/gems/rack-protection-1.2.0/lib/rack/protection/frame_options.rb
classiccms-0.6.1 vendor/bundle/gems/rack-protection-1.2.0/lib/rack/protection/frame_options.rb
classiccms-0.6.0 vendor/bundle/gems/rack-protection-1.2.0/lib/rack/protection/frame_options.rb
classiccms-0.5.17 vendor/bundle/gems/rack-protection-1.2.0/lib/rack/protection/frame_options.rb
classiccms-0.5.16 vendor/bundle/gems/rack-protection-1.2.0/lib/rack/protection/frame_options.rb
classiccms-0.5.15 vendor/bundle/gems/rack-protection-1.2.0/lib/rack/protection/frame_options.rb
classiccms-0.5.14 vendor/bundle/gems/rack-protection-1.2.0/lib/rack/protection/frame_options.rb