pub enum Hsts {
Disable,
Enable(u32),
IncludeSubDomains(u32),
Preload(u32),
}
Expand description
HTTP Strict Transport Security configuration settings and max-age
in
seconds for the links redirector.
The max-age
indicates for how long the server’s HSTS setting should be
saved by browsers, with 2 years (63072000 seconds) being recommended. For
preloading to work, max-age
must be at least 1 year (31536000 seconds).
Setting max-age
to 0 will clear a browser’s HSTS setting for the
redirection website on next request, allowing it to perform HTTP (without
TLS) requests again.
§Caution:
The IncludeSubDomains
and Preload
settings may have lasting unintended
effects on unrelated HTTP servers (current and future) running on subdomains
of the links host, and may even render those websites unusable for months or
years by requiring browsers to use HTTPS (with TLS) exclusively when doing
HTTP requests to those domains. The Enable
setting, however, only impacts
the exact domain it is used from, so should only impact the links redirector
server itself. It is recommended to start testing HSTS (especially
IncludeSubDomains
and Preload
) with a short max-age
initially, and to
test any possible impact on other websites hosted on the same domain and on
its subdomains.
See also:
Variants§
Disable
Don’t send the HTTP Strict Transport Security header
Enable(u32)
Send the HSTS header without the preload
or includeSubDomains
attributes
IncludeSubDomains(u32)
Send the HSTS header with the includeSubDomains
attribute, but without
preload
§Caution:
This may have temporary unintended effects on unrelated HTTP servers running on subdomains of the links host. Make sure that this won’t cause any problems before enabling it and try a short max-age first. More info on https://hstspreload.org/, https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security, and https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security.
Preload(u32)
Send the HSTS header with the preload
and includeSubDomains
attributes
§Caution:
This may have lasting unintended effects on unrelated HTTP servers (current and future) running on subdomains of the links host, and may even render those websites unusable for months or years.
Read https://hstspreload.org/, https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security, and https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security, and make sure that this won’t cause any problems before enabling it.
Trait Implementations§
impl Copy for Hsts
impl Eq for Hsts
impl StructuralPartialEq for Hsts
Auto Trait Implementations§
impl Freeze for Hsts
impl RefUnwindSafe for Hsts
impl Send for Hsts
impl Sync for Hsts
impl Unpin for Hsts
impl UnwindSafe for Hsts
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request