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
parent d573581eb7
commit ea761419ad

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)