pub enum CrossOriginResourcePolicy {
SameOrigin,
SameSite,
CrossOrigin,
}
Expand description
Manages Cross-Origin-Resource-Policy
header
The Cross-Origin-Resource-Policy HTTP response header conveys a desire that the browser blocks no-cors cross-origin/cross-site requests to the given resource.
§Values
- same-origin: The resource is same-origin to the document.
- same-site: The resource is same-site to the document.
- cross-origin: The resource is cross-origin to the document.
§Examples
use helmet_core::CrossOriginResourcePolicy;
let cross_origin_resource_policy = CrossOriginResourcePolicy::same_origin();
Variants§
Implementations§
Source§impl CrossOriginResourcePolicy
impl CrossOriginResourcePolicy
pub fn same_origin() -> Self
pub fn same_site() -> Self
pub fn cross_origin() -> Self
Trait Implementations§
Source§impl Clone for CrossOriginResourcePolicy
impl Clone for CrossOriginResourcePolicy
Source§fn clone(&self) -> CrossOriginResourcePolicy
fn clone(&self) -> CrossOriginResourcePolicy
Returns a copy 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 moreAuto Trait Implementations§
impl Freeze for CrossOriginResourcePolicy
impl RefUnwindSafe for CrossOriginResourcePolicy
impl Send for CrossOriginResourcePolicy
impl Sync for CrossOriginResourcePolicy
impl Unpin for CrossOriginResourcePolicy
impl UnwindSafe for CrossOriginResourcePolicy
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