class Kemal::Shield::StrictTransportSecurity

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.cr

Constant Summary

DEFAULT_MAX_AGE = ((180 * 24) * 60) * 60

The default max_age (15_552_000 seconds).

Constructors

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.


[View source]

Instance Method Detail

def call(context) #

[View source]