mirror of
https://github.com/denoland/deno.git
synced 2024-12-23 15:49:44 -05:00
fix(unstable): finish HTTP response for 205 and 304 responses (#15584)
This commit fixes "Deno.serve()" API by making sure that 205 and 304 responses end with "\r\n\r\n".
This commit is contained in:
parent
348291f5ec
commit
fb1c7b7dea
3 changed files with 8 additions and 2 deletions
|
@ -1844,6 +1844,7 @@ Deno.test(
|
|||
const msg = decoder.decode(buf.subarray(0, readResult));
|
||||
|
||||
assert(msg.startsWith("HTTP/1.1 304 Not Modified"));
|
||||
assert(msg.endsWith("\r\n\r\n"));
|
||||
|
||||
conn.close();
|
||||
|
||||
|
|
|
@ -714,7 +714,12 @@ Deno.test(function spawnSyncStdinPipedFails() {
|
|||
});
|
||||
|
||||
Deno.test(
|
||||
{ permissions: { write: true, run: true, read: true } },
|
||||
// TODO(bartlomieju): this test became flaky on Windows CI
|
||||
// raising "PermissionDenied" instead of "NotFound".
|
||||
{
|
||||
ignore: Deno.build.os === "windows",
|
||||
permissions: { write: true, run: true, read: true },
|
||||
},
|
||||
async function spawnChildUnref() {
|
||||
const enc = new TextEncoder();
|
||||
const cwd = await Deno.makeTempDir({ prefix: "deno_command_test" });
|
||||
|
|
|
@ -140,7 +140,7 @@
|
|||
// MUST NOT generate a payload in a 205 response.
|
||||
// indicate a zero-length body for the response by
|
||||
// including a Content-Length header field with a value of 0.
|
||||
str += "Content-Length: 0\r\n";
|
||||
str += "Content-Length: 0\r\n\r\n";
|
||||
return str;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue