The HTTP Strict-Transport-Security (HSTS) header: enforces strict HTTPS
usage.
HSTS tells the browser that the site should only be accessed using HTTPS
instead of HTTP. HSTS prevents a variety of downgrading attacks and should
always be used when TLS is enabled. SpaceHelmet
will turn HSTS on and
issue a warning if you enable TLS without enabling HSTS when the application
is run in the staging or production environments.
While HSTS is important for HTTPS security, incorrectly configured HSTS can
lead to problems as you are disallowing access to non-HTTPS enabled parts of
your site. Yelp engineering has good discussion of potential challenges
that can arise and how to roll this out in a large scale setting. So, if
you use TLS, use HSTS, but roll it out with care.
Browser should only permit this site to be accesses by HTTPS for the
next Duration
.
IncludeSubDomains(Duration)
Like Hsts::Enable
, but also apply to all of the site's subdomains.
Google maintains an HSTS preload service that can be used to prevent
the browser from ever connecting to your site over an insecure
connection. Read more here. Don't enable this before you have
registered your site.
The actual name of the HTTP header. Read more
Returns the Header
to attach to all outgoing responses. Read more
Defaults to Hsts::Enable(Duration::weeks(52))
.
Returns the "default value" for a type. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
impl<T> Typeable for T where T: Any, | |
Get the TypeId
of this object.
impl<T> IntoCollection for T | |
Converts self
into a collection.
fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where A: Array<Item = U>, F: FnMut(T) -> U, | |
impl<T, I> AsResult for T where I: Input, | |
Convert self
to an expression for Diesel's query builder. Read more
Convert &self
to an expression for Diesel's query builder. Read more