Skip to content

Commit 28ac28e

Browse files
committed
Merge branch '57-when-auto-cond-req-304-responses-have-content-length-0' into h
2 parents af03bec + 0fee76f commit 28ac28e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/response/EmptyResponse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export class EmptyResponse<A> extends Response<A> {
1616
}
1717

1818
protected override async send(res: http.ServerResponse, req?: Request<A>): Promise<void> {
19-
if (req !== undefined)
20-
req._responseHeaders.set("content-length", "0");
19+
if (!this.headers.has("content-length"))
20+
this.headers.set("content-length", "0");
2121
this.writeHead(res, req);
2222
res.end();
2323
}

0 commit comments

Comments
 (0)