Explain why a saved stylesheet response is blocked by nosniff
Admin ·
When a stylesheet fails to load, start with the final response headers. A redirect can advertise its own type, while the response carrying the stylesheet may declare something different.
Read the final response and its destination
Choose Load stylesheet example and Check content type. The report selects HTTP 200, block 2 of 2. It finds text/plain and a recognized nosniff value, then reports Blocked by the nosniff rule for the Stylesheet destination.
Change text/plain to text/css in the second response and check again. The same destination and header now produce Allowed by the nosniff rule. The first response still records the redirect and its own type.
HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8
X-Content-Type-Options: nosniffFetch Standard, X-Content-Type-OptionsRFC 9110 HTTP Semantics
Verify which response and rule were exported
Download content-type-evidence.json and check response.block, response.status, contentType.essence, options.nosniff and outcome. For the corrected sample, the block is 2, status is 200, essence is text/css and nosniff is true.
Use Response block number when your saved body belongs to an earlier response. A 304 or 204 response has no body to compare. A partial 206 response can start after the original file signature.
RFC 9110 HTTP SemanticsFetch Standard, X-Content-Type-Options
Interpret an optional local body signature
Select the saved body if it starts with the original representation bytes. The report can recognize signatures such as PNG, JPEG and PDF in the first 4,096 bytes and compare them with the declared type.
CSS and JavaScript are text and normally give an inconclusive signature. Use the HTTP header and destination to assess this rule, then confirm the corrected response in the browser where the asset will load.
WHATWG MIME Sniffing StandardFetch Standard, X-Content-Type-Options
Common questions
Why can an image and a stylesheet show different outcomes for the same header?
The check models the Fetch nosniff rule for script-like and stylesheet destinations. Browser handling of images uses a different context.
Can a body file establish what the server sent?
A file supplies useful byte evidence. Use the saved response block, encoding and capture method to establish that the file actually came from that response.