pub enum Referrer {
NoReferrer,
NoReferrerWhenDowngrade,
Origin,
OriginWhenCrossOrigin,
SameOrigin,
StrictOrigin,
StrictOriginWhenCrossOrigin,
UnsafeUrl,
}
Expand description
The Referrer-Policy header: controls the value set by the browser for the Referer header.
Tells the browser if it should send all or part of URL of the current page to the next site the user navigates to via the Referer header. This can be important for security as the URL itself might expose sensitive data, such as a hidden file path or personal identifier.
Variants§
NoReferrer
Omits the Referer
header (SpaceHelmet default).
NoReferrerWhenDowngrade
Omits the Referer
header on connection downgrade i.e. following HTTP
link from HTTPS site (Browser default).
Origin
Only send the origin of part of the URL, e.g. the origin of https://foo.com/bob.html is https://foo.com
OriginWhenCrossOrigin
Send full URL for same-origin requests, only send origin part when replying to cross-origin requests.
SameOrigin
Send full URL for same-origin requests only.
StrictOrigin
Only send origin part of URL, only send if protocol security level remains the same e.g. HTTPS to HTTPS.
StrictOriginWhenCrossOrigin
Send full URL for same-origin requests. For cross-origin requests, only send origin part of URL if protocl security level remains the same e.g. HTTPS to HTTPS.
UnsafeUrl
Send full URL for same-origin or cross-origin requests. This will leak the full URL of TLS protected resources to insecure origins. Use with caution.
Trait Implementations§
Source§impl Default for Referrer
impl Default for Referrer
Defaults to Referrer::NoReferrer
. Tells the browser to omit the
Referer
header.
Auto Trait Implementations§
impl Freeze for Referrer
impl RefUnwindSafe for Referrer
impl Send for Referrer
impl Sync for Referrer
impl Unpin for Referrer
impl UnwindSafe for Referrer
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
§impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
self
to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
&self
to an expression for Diesel’s query builder. Read more