Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /fetch/orb/tentative/nosniff.sub.window.html - WPT Dashboard Interop Dashboard
// META: script=/fetch/orb/resources/utils.js
// META: script=resources/utils.js
// This is an exception that allow more MIME types than the ORB spec does.
// This is due to web compatibility, but might be removed in the future.
promise_test(
t => testFetchNoCors(
`${path}/text.txt`,
null,
contentType("text/plain"),
contentTypeOptions("nosniff")
),
"ORB shouldn't block opaque text/plain with nosniff"
);
// Due to web compatibility we filter opaque Response object from the
// might be removed in the future.
promise_internal_response_is_filtered(
testFetchNoCors(
`${path}/data.json`,
null,
contentType("application/json"),
contentTypeOptions("nosniff")
),
"ORB should filter opaque-response-blocklisted MIME type with nosniff"
);
// Due to web compatibility we filter opaque Response object from the
// might be removed in the future.
promise_internal_response_is_filtered(
testFetchNoCors(
`${path}/data.json`,
null,
contentType(""),
contentTypeOptions("nosniff")
),
"ORB should filter opaque response with empty Content-Type and nosniff"
);