From 007025f2668391889c68521b932018933c0a2047 Mon Sep 17 00:00:00 2001 From: ADITYA CHAUHAN <125276621+hooiv@users.noreply.github.com> Date: Sun, 27 Jul 2025 15:35:22 +0530 Subject: [PATCH] Add examples for X-Content-Type-Options header Add examples for X-Content-Type-Options header Addresses issue [#636](https://github.com/whatwg/fetch/issues/636) by adding comprehensive examples to the 'Should response to request be blocked due to nosniff?' algorithm. The examples clarify: - When responses are blocked (MIME type mismatch, missing Content-Type) - When responses are allowed (correct MIME type, no X-Content-Type-Options header) - Different request destinations (script, style, image) This should help web developers and implementers understand the exact behavior of the X-Content-Type-Options: nosniff directive. --- fetch.bs | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/fetch.bs b/fetch.bs index 4d01e315b..85ca5f9fe 100755 --- a/fetch.bs +++ b/fetch.bs @@ -4030,6 +4030,53 @@ X-Content-Type-Options = "nosniff" ; case-insensitive

Only request destinations that are script-like or "style" are considered as any exploits pertain to them. Also, considering "image" was not compatible with deployed content. + +

+

The following examples illustrate how the algorithm works: + +

+