pub struct SecurityHeaders { /* private fields */ }Expand description
Middleware adding security headers, see the module documentation
Implementations§
Source§impl SecurityHeaders
impl SecurityHeaders
pub fn new() -> Self
Sourcepub fn csp(self, csp: Csp) -> Self
pub fn csp(self, csp: Csp) -> Self
Send a Content-Security-Policy (none by default: a good policy depends on the app)
Sourcepub fn frame_options(self, options: impl Into<Option<FrameOptions>>) -> Self
pub fn frame_options(self, options: impl Into<Option<FrameOptions>>) -> Self
X-Frame-Options (default DENY); None omits it, e.g. when the CSP’s
frame-ancestors should be the only rule
Trait Implementations§
Source§impl Clone for SecurityHeaders
impl Clone for SecurityHeaders
Source§impl Debug for SecurityHeaders
impl Debug for SecurityHeaders
Source§impl Default for SecurityHeaders
impl Default for SecurityHeaders
Auto Trait Implementations§
impl !Freeze for SecurityHeaders
impl RefUnwindSafe for SecurityHeaders
impl Send for SecurityHeaders
impl Sync for SecurityHeaders
impl Unpin for SecurityHeaders
impl UnsafeUnpin for SecurityHeaders
impl UnwindSafe for SecurityHeaders
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