class

Lucky::ForceSSLHandler

Inherits Habitat::SettingsHelpers < Habitat::TempConfig < HTTP::Handler < Reference < Object

Enabled - The handler can be enabled/disabled. This is helpful for working in a local development environment.

Strict-Transport-Security - Settings to configure the 'Strict-Transport-Security' header

# Usually in config/force_ssl_handler.cr
Lucky::ForceSSLHandler.configure do |settings|
  settings.redirect_status = 303
  settings.enabled = false
  settings.strict_transport_security = {max_age: 1.year, include_subdomains: true}
end

Constants

HABITAT_SETTINGS = [{decl: redirect_status : Int32 = HTTP::Status::PERMANENT_REDIRECT.value, example: nil, validation: nil}, {decl: enabled : Bool, example: nil, validation: nil}, {decl: strict_transport_security : NamedTuple(max_age: Time::Span | Time::MonthSpan, include_subdomains: Bool) | ::Nil, example: nil, validation: nil}] of Nil

Class methods

configure
Source
settings
Source

Instance methods

settings
Source

Nested types