Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /fetch/content-encoding/gzip/bad-gzip-body.any.html - WPT Dashboard Interop Dashboard
- /fetch/content-encoding/gzip/bad-gzip-body.any.serviceworker.html - WPT Dashboard Interop Dashboard
- /fetch/content-encoding/gzip/bad-gzip-body.any.sharedworker.html - WPT Dashboard Interop Dashboard
- /fetch/content-encoding/gzip/bad-gzip-body.any.worker.html - WPT Dashboard Interop Dashboard
// META: global=window,worker
promise_test((test) => {
return fetch("resources/bad-gzip-body.py").then(res => {
assert_equals(res.status, 200);
});
}, "Fetching a resource with bad gzip content should still resolve");
[
"arrayBuffer",
"blob",
"formData",
"json",
"text"
].forEach(method => {
promise_test(t => {
return fetch("resources/bad-gzip-body.py").then(res => {
assert_equals(res.status, 200);
return promise_rejects_js(t, TypeError, res[method]());
});
}, "Consuming the body of a resource with bad gzip content with " + method + "() should reject");
});