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 (returned by Referrer::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 protocol 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
sourceimpl Default for Referrer
impl Default for Referrer
Defaults to Referrer::NoReferrer
. Tells the browser to omit the
Referer
header.
Auto Trait Implementations
impl RefUnwindSafe for Referrer
impl Send for Referrer
impl Sync for Referrer
impl Unpin for Referrer
impl UnwindSafe for Referrer
Blanket Implementations
impl<'a, T> AsTaggedExplicit<'a> for T where
T: 'a,
impl<'a, T> AsTaggedExplicit<'a> for T where
T: 'a,
fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self>
impl<'a, T> AsTaggedImplicit<'a> for T where
T: 'a,
impl<'a, T> AsTaggedImplicit<'a> for T where
T: 'a,
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
Converts self
into a collection.
fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where
F: FnMut(T) -> U,
A: Array<Item = U>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more