Fix asynchttpserver newline breaking content-length (#14565) [backport]

This commit is contained in:
Zed 2020-06-06 12:20:11 +02:00 • committed by GitHub
commit ea761419ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -105,8 +105,9 @@ proc respond*(req: Request, code: HttpCode, content: string,
msg.add("Content-Length: ")
# this particular way saves allocations:
msg.addInt content.len
msg.add "\c\L\c\L"
msg.add "\c\L"
msg.add "\c\L"
msg.add(content)
result = req.client.send(msg)