Sha256: 41cdc1ad91bcd793ae94c716e02c7d45966b7c60c00aad34fc888d39d356f3ef

Contents?: true

Size: 802 Bytes

Versions: 8

Compression:

Stored size: 802 Bytes

Contents

module Ixtlan
  module Core
    module XFrameHeaders

      protected

      def x_frame_headers(mode = nil)
        case mode || self.class.instance_variable_get(:@_x_frame_mode) || Rails.configuration.x_frame_headers
        when :deny
          response.headers["X-FRAME-OPTIONS"] = "DENY"
        when :sameorigin
          response.headers["X-FRAME-OPTIONS"] = "SAMEORIGIN"
        when :off
        else
          warn "allowed values for x_frame_headers are :deny, :sameorigin, :off"
        end
      end
    
      def self.included(base)
        base.class_eval do
          def self.x_frame_headers(mode)
            if(mode)
              @_x_frame_mode = mode.to_sym
            else
              @_x_frame_mode = nil
            end
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ixtlan-core-0.8.0 lib/ixtlan/core/x_content_headers.rb~
ixtlan-core-0.7.5 lib/ixtlan/core/x_content_headers.rb~
ixtlan-core-0.7.4 lib/ixtlan/core/x_content_headers.rb~
ixtlan-core-0.7.3 lib/ixtlan/core/x_content_headers.rb~
ixtlan-core-0.7.2 lib/ixtlan/core/x_content_headers.rb~
ixtlan-core-0.7.1 lib/ixtlan/core/x_content_headers.rb~
ixtlan-core-0.7.0 lib/ixtlan/core/x_content_headers.rb~
ixtlan-core-0.6.1 lib/ixtlan/core/x_content_headers.rb~