Class: SSLyze::XML::HTTPHeaders::HTTPStrictTransportSecurity

Inherits:
Object
  • Object
show all
Includes:
Attributes::Exception, Attributes::IsSupported, Types
Defined in:
lib/sslyze/xml/http_headers/http_strict_transport_security.rb

Overview

Represents the <httpStrictTransportSecurity/> XML element.

Since:

  • 1.0.0

Constant Summary

Constants included from Types

Types::Boolean, Types::None

Instance Method Summary collapse

Methods included from Attributes::Exception

#exception, #exception?

Methods included from Attributes::IsSupported

#is_supported?

Constructor Details

#initialize(node) ⇒ HTTPStrictTransportSecurity

Since:

  • 1.0.0



23
24
25
# File 'lib/sslyze/xml/http_headers/http_strict_transport_security.rb', line 23

def initialize(node)
  @node = node
end

Instance Method Details

#include_sub_domains?Boolean

Parses the includeSubDomains XML attribute.

Returns:

Since:

  • 1.0.0



32
33
34
# File 'lib/sslyze/xml/http_headers/http_strict_transport_security.rb', line 32

def include_sub_domains?
  Boolean[@node['includeSubDomains']]
end

#max_ageInteger?

Parses the maxAge XML attribute.

Returns:

  • (Integer, nil)

Since:

  • 1.0.0



41
42
43
44
45
# File 'lib/sslyze/xml/http_headers/http_strict_transport_security.rb', line 41

def max_age
  @max_age ||= if (value = @node['maxAge'])
                 value.to_i
               end
end

#preload?Boolean

Parses the preload XML attribute.

Returns:

Since:

  • 1.0.0



52
53
54
# File 'lib/sslyze/xml/http_headers/http_strict_transport_security.rb', line 52

def preload?
  Boolean[@node['preload']]
end