pub enum XContentTypeOptions {
NoSniff,
}Expand description
Manages X-Content-Type-Options header
The X-Content-Type-Options response HTTP header is a marker used by the server to indicate that the MIME types advertised in the Content-Type headers should not be changed and be followed. This allows to opt-out of MIME type sniffing, or, in other words, it is a way to say that the webmasters knew what they were doing.
§Values
- nosniff: Prevents the browser from MIME-sniffing a response away from the declared content-type. This also applies to Google Chrome, when downloading extensions.
§Examples
use helmet_core::XContentTypeOptions;
let x_content_type_options = XContentTypeOptions::nosniff();Variants§
NoSniff
Implementations§
Source§impl XContentTypeOptions
impl XContentTypeOptions
pub fn nosniff() -> XContentTypeOptions
Trait Implementations§
Source§impl Clone for XContentTypeOptions
impl Clone for XContentTypeOptions
Source§fn clone(&self) -> XContentTypeOptions
fn clone(&self) -> XContentTypeOptions
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 Display for XContentTypeOptions
impl Display for XContentTypeOptions
Auto Trait Implementations§
impl Freeze for XContentTypeOptions
impl RefUnwindSafe for XContentTypeOptions
impl Send for XContentTypeOptions
impl Sync for XContentTypeOptions
impl Unpin for XContentTypeOptions
impl UnwindSafe for XContentTypeOptions
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