Class: SecureHeaders::XXssProtection
- Includes:
- Constants
- Defined in:
- lib/secure_headers/headers/x_xss_protection.rb
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.
11 12 13 14 |
# File 'lib/secure_headers/headers/x_xss_protection.rb', line 11 def initialize(config=nil) @config = config validate_config unless @config.nil? end |
Instance Method Details
#name ⇒ Object
16 17 18 |
# File 'lib/secure_headers/headers/x_xss_protection.rb', line 16 def name X_XSS_PROTECTION_HEADER_NAME end |
#value ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/secure_headers/headers/x_xss_protection.rb', line 20 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 |