pub struct CrossOriginProtectionLayer { /* private fields */ }Expand description
Decorates a HTTP service with CSRF protection.
Implementations§
Source§impl CrossOriginProtectionLayer
impl CrossOriginProtectionLayer
Sourcepub fn add_trusted_origin<S: Into<String>>(
self,
origin: S,
) -> Result<Self, ConfigError>
pub fn add_trusted_origin<S: Into<String>>( self, origin: S, ) -> Result<Self, ConfigError>
Adds a trusted origin which allows all requests with an Origin header which exactly matches
the given value.
Origin header values are of the form scheme://host[:port].
Sourcepub fn with_insecure_bypass<F>(self, predicate: F) -> CrossOriginProtectionLayer
pub fn with_insecure_bypass<F>(self, predicate: F) -> CrossOriginProtectionLayer
Adds a bypass function that returns true if the given request should bypass CSRF protection. Notes that this
might be insecure.
Trait Implementations§
Source§impl Clone for CrossOriginProtectionLayer
impl Clone for CrossOriginProtectionLayer
Source§fn clone(&self) -> CrossOriginProtectionLayer
fn clone(&self) -> CrossOriginProtectionLayer
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 CrossOriginProtectionLayer
impl Debug for CrossOriginProtectionLayer
Source§impl Default for CrossOriginProtectionLayer
impl Default for CrossOriginProtectionLayer
Auto Trait Implementations§
impl Freeze for CrossOriginProtectionLayer
impl !RefUnwindSafe for CrossOriginProtectionLayer
impl Send for CrossOriginProtectionLayer
impl Sync for CrossOriginProtectionLayer
impl Unpin for CrossOriginProtectionLayer
impl !UnwindSafe for CrossOriginProtectionLayer
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