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: The page can only be displayed in a frame on the specified origin. Requires a URI as an argument.
§Examples
use helmet_core::XFrameOptions;
let x_frame_options = XFrameOptions::deny();
let x_frame_options = XFrameOptions::same_origin();
let x_frame_options = XFrameOptions::allow_from("https://example.com");
Variants§
Implementations§
Source§impl XFrameOptions
impl XFrameOptions
pub fn deny() -> Self
pub fn same_origin() -> Self
pub fn allow_from(uri: &str) -> Self
Trait Implementations§
Source§impl Clone for XFrameOptions
impl Clone for XFrameOptions
Source§fn clone(&self) -> XFrameOptions
fn clone(&self) -> XFrameOptions
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 moreSource§impl Display for XFrameOptions
impl Display for XFrameOptions
Auto Trait Implementations§
impl Freeze for XFrameOptions
impl RefUnwindSafe for XFrameOptions
impl Send for XFrameOptions
impl Sync for XFrameOptions
impl Unpin 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