class

Kemal::Shield::StrictTransportSecurity

Inherits Kemal::Shield::Handler / Kemal::Handler / Kemal::HandlerInterface / HTTP::Handler / Reference / Object

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

Constants

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.

An ArgumentError is raise if max_age is less than 0.

Source

Instance methods

call(context)
Source