-
Notifications
You must be signed in to change notification settings - Fork 121
Open
Description
Test Code in:
https://github.com/xflywind/test_jester
Got Error: ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH
Because jester sends multiple content length.
# in asynchttpserver.nim
# https://github.com/nim-lang/Nim/blob/b6924383df63c91f0ad6baf63d0b1aa84f9329b7/lib/pure/asynchttpserver.nim#L102
proc respond*(req: Request, code: HttpCode, content: string,
headers: HttpHeaders = nil): Future[void] =
if headers != nil:
msg.addHeaders(headers)
msg.add("Content-Length: ")
# this particular way saves allocations:
msg.add content.len
msg.add "\c\L\c\L"
msg.add(content)
result = req.client.send(msg)# in jester
# https://github.com/dom96/jester/blob/d8a03aa4c681bc8514bb7bbf4953d380d86f5bd6/jester.nim#L202
let headers = @({
"Content-Type": mimetype,
"Content-Length": $fileSize
})
await req.statusContent(Http200, "", some(headers))Relative codes:
Line 202 in d8a03aa
| "Content-Length": $fileSize |
Metadata
Metadata
Assignees
Labels
No labels