Skip to content

Commit

Permalink
refactor: set content-length as number with outgoing.writeHead()
Browse files Browse the repository at this point in the history
  • Loading branch information
yusukebe committed Nov 29, 2023
1 parent 096e27d commit 773d79d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const responseViaCache = (
): undefined | Promise<undefined> => {
const [status, body, header] = (res as any)[cacheKey]
if (typeof body === 'string') {
header['content-length'] ||= '' + Buffer.byteLength(body)
header['Content-Length'] = Buffer.byteLength(body)
outgoing.writeHead(status, header)
outgoing.end(body)
} else {
Expand Down

0 comments on commit 773d79d

Please sign in to comment.