1. Home
  2. Glossary
  3. X-Content-Type-Options
Security

X-Content-Type-Options

An HTTP response header whose only valid value, nosniff, stops browsers from guessing a file's type and forces them to respect the declared Content-Type.

Why it matters

Stopping browsers from guessing file types prevents some attacks where an uploaded file is run as a script.

Example

X-Content-Type-Options: nosniff

Where you will see it

The free Security headers checker looks at this on a live page and explains what it finds in plain English: grade HSTS, CSP and the other protective headers, with copy-paste fixes for Nginx, Apache, Cloudflare and Netlify.

Related terms

  • Content-Security-Policy: An HTTP response header that lists which sources a page may load scripts, styles, images and other resources from.
  • HTTP header: A name and value pair sent along with a request or a response.
  • Clickjacking protection: Protection against another site embedding yours in a hidden frame to trick visitors into clicking.

Go deeper

  • Security headers explained: What HSTS, Content-Security-Policy, X-Content-Type-Options, frame-ancestors, Referrer-Policy and Permissions-Policy do, with safe example values.

← All 66 glossary terms

↑ ↓ to moveEnter to openEsc to closeAll results