mirror of
https://github.com/denoland/deno.git
synced 2024-11-22 15:06:54 -05:00
fix(fetch): OPTIONS should be allowed a non-null body (#11242)
This commit is contained in:
parent
3ee0c36453
commit
a6c840d150
2 changed files with 11 additions and 1 deletions
|
@ -1217,3 +1217,13 @@ unitTest(
|
|||
await done;
|
||||
},
|
||||
);
|
||||
|
||||
unitTest(
|
||||
{ perms: { net: true } },
|
||||
async function fetchHeadRespBody() {
|
||||
const res = await fetch("http://localhost:4545/echo_server", {
|
||||
method: "HEAD",
|
||||
});
|
||||
assertEquals(res.body, null);
|
||||
},
|
||||
);
|
||||
|
|
|
@ -271,7 +271,7 @@
|
|||
if (nullBodyStatus(response.status)) {
|
||||
core.close(resp.responseRid);
|
||||
} else {
|
||||
if (req.method === "HEAD" || req.method === "OPTIONS") {
|
||||
if (req.method === "HEAD" || req.method === "CONNECT") {
|
||||
response.body = null;
|
||||
core.close(resp.responseRid);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue