pub enum XFrameOptions {
Deny,
SameOrigin,
AllowFrom(String),
}Expand description
Manages X-Frame-Options header
The X-Frame-Options HTTP response header can be used to to avoid click-jacking attacks by preventing the content to be included in other websites.
§Values
- deny: The page cannot be displayed in a frame, regardless of the site attempting to do so.
- sameorigin: The page can only be displayed in a frame on the same origin as the page itself.
- allow-from: Deprecated. Ignored by all modern browsers. Use
ContentSecurityPolicy::new().frame_ancestors(...)instead.
§Examples
use helmet_core::XFrameOptions;
let x_frame_options = XFrameOptions::deny();
let x_frame_options = XFrameOptions::same_origin();Variants§
Deny
SameOrigin
AllowFrom(String)
👎Deprecated: ALLOW-FROM is ignored by modern browsers. Use ContentSecurityPolicy::new().frame_ancestors(…) instead.
Implementations§
Source§impl XFrameOptions
impl XFrameOptions
pub fn deny() -> XFrameOptions
pub fn same_origin() -> XFrameOptions
pub fn allow_from(uri: &str) -> XFrameOptions
👎Deprecated: ALLOW-FROM is ignored by modern browsers. Use ContentSecurityPolicy::new().frame_ancestors(…) instead.
Trait Implementations§
Source§impl Clone for XFrameOptions
impl Clone for XFrameOptions
Source§fn clone(&self) -> XFrameOptions
fn clone(&self) -> XFrameOptions
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 moreAuto Trait Implementations§
impl Freeze for XFrameOptions
impl RefUnwindSafe for XFrameOptions
impl Send for XFrameOptions
impl Sync for XFrameOptions
impl Unpin for XFrameOptions
impl UnsafeUnpin for XFrameOptions
impl UnwindSafe for XFrameOptions
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