Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4202,6 +4202,23 @@ Content-Type:


<h3 id=x-content-type-options-header>`<code>X-Content-Type-Options</code>` header</h3>
<div class=example>
<p>Example: Using the <code>X-Content-Type-Options</code> header to prevent MIME type sniffing.</p>
<pre><code>HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
X-Content-Type-Options: nosniff

&lt;!doctype html&gt;
&lt;html&gt;
&lt;head&gt;&lt;title&gt;Secure Page&lt;/title&gt;&lt;/head&gt;
&lt;body&gt;
&lt;script src="data:text/plain,alert('This script will be blocked')">&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
<p>This prevents browsers from interpreting resources as a different MIME type than declared,
helping to mitigate certain types of cross-site scripting attacks.</p>
</div>

<p>The
`<dfn export http-header id=http-x-content-type-options><code>X-Content-Type-Options</code></dfn>`
Expand Down