mirror of
https://github.com/denoland/deno.git
synced 2024-10-29 08:58:01 -04:00
fix: appended CRLF to end of trailer headers (#3989)
This commit is contained in:
parent
9325744a94
commit
621aeef836
2 changed files with 3 additions and 1 deletions
|
@ -84,6 +84,7 @@ export async function writeTrailers(
|
|||
);
|
||||
await writer.write(encoder.encode(`${key}: ${value}\r\n`));
|
||||
}
|
||||
await writer.write(encoder.encode("\r\n"));
|
||||
await writer.flush();
|
||||
}
|
||||
|
||||
|
|
|
@ -456,6 +456,7 @@ test("writeResponse with trailer", async () => {
|
|||
"",
|
||||
"deno: land",
|
||||
"node: js",
|
||||
"",
|
||||
""
|
||||
].join("\r\n");
|
||||
assertEquals(ret, exp);
|
||||
|
@ -775,7 +776,7 @@ test("writeTrailer", async () => {
|
|||
new Headers({ "transfer-encoding": "chunked", trailer: "deno,node" }),
|
||||
new Headers({ deno: "land", node: "js" })
|
||||
);
|
||||
assertEquals(w.toString(), "deno: land\r\nnode: js\r\n");
|
||||
assertEquals(w.toString(), "deno: land\r\nnode: js\r\n\r\n");
|
||||
});
|
||||
|
||||
test("writeTrailer should throw", async () => {
|
||||
|
|
Loading…
Reference in a new issue