Plug.SSL
A plug to force SSL
If the scheme of a request is https, it’ll add strict-transport-security
header to enable HTTP Strict Transport Security.
Otherwise, the request will be redirected to a corresponding location
with https scheme by setting the location header of the reponse.
And the status code will be 301 if method of conn is GET or HEAD,
or 307 in other situations.
Options
:hsts- a boolean on enabling HSTS or not and defaults to true.:expires- seconds to expires for HSTS, defaults to 31536000(a year).:subdomains- a boolean on including subdomains or not in HSTS, defaults to false.:host- a new host to redirect to if the request’s scheme ishttp.
Summary↑
| call(conn, arg2) | Callback implementation for |
| init(opts) | Callback implementation for |
Functions
Callback implementation for Plug.call/2.
Callback implementation for Plug.init/1.