pub enum ReferrerPolicy {
NoReferrer,
NoReferrerWhenDowngrade,
Origin,
OriginWhenCrossOrigin,
SameOrigin,
StrictOrigin,
StrictOriginWhenCrossOrigin,
UnsafeUrl,
}Expand description
Referrer-Policy header value.
§Examples
use http_security_headers::ReferrerPolicy;
let policy = ReferrerPolicy::NoReferrer;
let policy = ReferrerPolicy::StrictOriginWhenCrossOrigin;Variants§
NoReferrer
No referrer information is sent.
NoReferrerWhenDowngrade
Only send the origin when the protocol security level stays the same (HTTPS→HTTPS).
Origin
Only send the origin, not the full URL.
OriginWhenCrossOrigin
Send the full URL when performing a same-origin request, but only the origin for other cases.
SameOrigin
Send the full URL for same-origin requests, and no referrer for cross-origin requests.
StrictOrigin
Only send the origin when the protocol security level stays the same (HTTPS→HTTPS), and send no referrer to a less secure destination (HTTPS→HTTP).
StrictOriginWhenCrossOrigin
Send the full URL for same-origin requests, only the origin for cross-origin requests on the same protocol level, and no referrer to less secure destinations.
UnsafeUrl
Send the full URL for all requests.
Implementations§
Trait Implementations§
Source§impl Clone for ReferrerPolicy
impl Clone for ReferrerPolicy
Source§fn clone(&self) -> ReferrerPolicy
fn clone(&self) -> ReferrerPolicy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReferrerPolicy
impl Debug for ReferrerPolicy
Source§impl Display for ReferrerPolicy
impl Display for ReferrerPolicy
Source§impl PartialEq for ReferrerPolicy
impl PartialEq for ReferrerPolicy
impl Copy for ReferrerPolicy
impl Eq for ReferrerPolicy
impl StructuralPartialEq for ReferrerPolicy
Auto Trait Implementations§
impl Freeze for ReferrerPolicy
impl RefUnwindSafe for ReferrerPolicy
impl Send for ReferrerPolicy
impl Sync for ReferrerPolicy
impl Unpin for ReferrerPolicy
impl UnwindSafe for ReferrerPolicy
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
Mutably borrows from an owned value. Read more