Class: HTTP::Security::Headers::XContentTypeOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/http/security/headers/x_content_type_options.rb

Instance Method Summary collapse

Constructor Details

#initialize(directives = {}) ⇒ XContentTypeOptions

Returns a new instance of XContentTypeOptions.



6
7
8
# File 'lib/http/security/headers/x_content_type_options.rb', line 6

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

Instance Method Details

#no_sniff?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/http/security/headers/x_content_type_options.rb', line 10

def no_sniff?
  !!@no_sniff
end

#to_sObject



14
15
16
17
18
19
# File 'lib/http/security/headers/x_content_type_options.rb', line 14

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

  return str
end