class Kemal::Shield::StrictTransportSecurity
- Kemal::Shield::StrictTransportSecurity
- Kemal::Shield::Handler
- Kemal::Handler
- Reference
- Object
Overview
Kemal::Shield::StrictTransportSecurity
is a handler that sets the Strict-Transport-Security HTTP header.
Default values:
Kemal::Shield.config.sts_max_age = 180 * 24 * 60 * 60
Kemal::Shield.config.sts_include_sub = true
Kemal::Shield.config.sts_preload = false
This handler can be turned of by setting
Kemal::Shield.config.sts_on = false
Defined in:
kemal-shield/handlers/strict_transport_security.crConstant Summary
-
DEFAULT_MAX_AGE =
((180 * 24) * 60) * 60
-
The default max_age (15_552_000 seconds).
Constructors
-
.new(max_age : Int32 = DEFAULT_MAX_AGE, include_sub_domains : Bool = true, preload : Bool = false)
Creates a new
Kemal::Shield::StrictTransportSecurity
handler.
Instance Method Summary
Constructor Detail
def self.new(max_age : Int32 = DEFAULT_MAX_AGE, include_sub_domains : Bool = true, preload : Bool = false)
#
Creates a new Kemal::Shield::StrictTransportSecurity
handler.
An ArgumentError
is raise if max_age is less than 0.