mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-31 10:22:15 +00:00
Fix asynchttpserver newline breaking content-length (#14565) [backport]
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user