Module: Tynn::ForceSSL
- Defined in:
- lib/tynn/force_ssl.rb
Overview
Public: HTTP requests are permanently redirected to their HTTPS counterparts.
Examples
require "tynn"
require "tynn/force_ssl"
require "tynn/test"
Tynn.plugin(Tynn::ForceSSL)
Tynn.define { }
app = Tynn::Test.new
app.get("/", {}, "HTTP_HOST" => "tynn.xyz")
app.res.headers["Location"]
# => "https://tynn.xyz/"
Defined Under Namespace
Classes: Middleware
Class Method Summary collapse
-
.setup(app) ⇒ Object
Internal: Sets the HTTPS redirect middleware.
Class Method Details
.setup(app) ⇒ Object
Internal: Sets the HTTPS redirect middleware.
23 24 25 |
# File 'lib/tynn/force_ssl.rb', line 23 def self.setup(app) app.use(Tynn::ForceSSL::Middleware) end |