docs.rodeo

MDN Web Docs mirror

X-Content-Type-Options

{{HTTPSidebar}} 

The HTTP X-Content-Type-Options {{Glossary("response header")}}  indicates that the MIME types advertised in the {{HTTPHeader("Content-Type")}}  headers should be respected and not changed. The header allows you to avoid MIME type sniffing by specifying that the MIME types are deliberately configured.

Site security testers usually expect this header to be set.

[!NOTE] The X-Content-Type-Options header only apply request-blocking due to nosniff for request destinations of "script" and "style". However, it also enables Cross-Origin Read Blocking (CORB) protection for HTML, TXT, JSON and XML files (excluding SVG image/svg+xml).

Header type `{{Glossary("Response header")}}` 
`{{Glossary("Forbidden header name")}}`  No

Syntax

X-Content-Type-Options: nosniff

Directives

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN