class Lucky::ForceSSLHandler

Overview

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

Included Modules

Defined in:

lucky/force_ssl_handler.cr

Constant Summary

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 Method Summary

Instance Method Summary

Class Method Detail

def self.configure(&) #

[View source]
def self.settings #

[View source]

Instance Method Detail

def call(context) #

[View source]
def settings #

[View source]