trailofbits/http-security

View on GitHub
lib/http/security/headers/x_content_type_options.rb

Summary

Maintainability
A
20 mins
Test Coverage
module HTTP
  module Security
    module Headers
      class XContentTypeOptions

        def initialize(directives={})
          @no_sniff = directives[:nosniff]
        end

        def no_sniff?
          !!@no_sniff
        end

        def to_s
          str = ''
          str << "nosniff" if @no_sniff

          return str
        end

      end
    end
  end
end