Skip to content

Commit 8fc5603

Browse files
authored
Merge branch 'main' into 26-set-textplain-as-default-for-textresponse-unless-overriden
2 parents 9b97bf4 + 8c557cb commit 8fc5603

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)