Class: SecureHeaders::XXssProtection
- Inherits:
-
Object
- Object
- SecureHeaders::XXssProtection
- Includes:
- Constants
- Defined in:
- lib/secure_headers/headers/x_xss_protection.rb
Overview
IE only
Defined Under Namespace
Modules: Constants
Constant Summary
Constants included from Constants
Constants::DEFAULT_VALUE, Constants::VALID_X_XSS_HEADER, Constants::X_XSS_PROTECTION_HEADER_NAME
Instance Method Summary collapse
-
#initialize(config = nil) ⇒ XXssProtection
constructor
A new instance of XXssProtection.
- #name ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(config = nil) ⇒ XXssProtection
Returns a new instance of XXssProtection.
12 13 14 15 |
# File 'lib/secure_headers/headers/x_xss_protection.rb', line 12 def initialize(config=nil) @config = config validate_config unless @config.nil? end |
Instance Method Details
#name ⇒ Object
17 18 19 |
# File 'lib/secure_headers/headers/x_xss_protection.rb', line 17 def name X_XSS_PROTECTION_HEADER_NAME end |
#value ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/secure_headers/headers/x_xss_protection.rb', line 21 def value case @config when NilClass DEFAULT_VALUE when String @config else value = @config[:value].to_s value += "; mode=#{@config[:mode]}" if @config[:mode] value end end |