[Webkit-unassigned] [Bug 236582] New: Response.body is not null for fetch responses with null status codes or HEAD methods

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 14 03:09:15 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=236582

            Bug ID: 236582
           Summary: Response.body is not null for fetch responses with
                    null status codes or HEAD methods
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: All
                OS: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: hello at lcas.dev

The fetch spec mandates that `Response.body` should be `null` if the `Response` has a null status code (like 204), or if the `Response` is the result of a request with a `HEAD` method.

WebKit correctly enforces this for manual construction of `Response` using the response constructor (ie `new Response("hey", { status: 204 })` errors), but it does not for responses originating from the network:

```js
const resp = await fetch("https://example.com", { method: "HEAD" });
console.log(resp.body); // this is not null
```

WPTs for this were added here: https://github.com/web-platform-tests/wpt/pull/32813

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220214/8b9a3efb/attachment.htm>


More information about the webkit-unassigned mailing list