Sha256: 5d0a623e9347bcd0b4dfb4e7116c631c0591e2c3f3a9e3c4fdca178964c71d6a

Contents?: true

Size: 795 Bytes

Versions: 9

Compression:

Stored size: 795 Bytes

Contents

module Ixtlan
  module Core
    module XContentTypeHeaders

      protected

      def x_content_type_headers(mode = nil)
        case mode || self.class.instance_variable_get(:@_x_content_type_headers) || Rails.configuration.x_content_type_headers || :nosniff
        when :nosniff
          response.headers["X-Content-Type-Options"] = "nosniff"
        when :off
        else
          warn "allowed values for x_content_type_headers are :nosniff, :off"
        end
      end
    
      def self.included(base)
        base.class_eval do
          def self.x_content_type_headers(mode)
            if(mode)
              @_x_content_type_headers = mode.to_sym
            else
              @_x_content_type_headers = nil
            end
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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