mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 21:40:32 +00:00
httpclient: strip trailing whitespace from headers.
- we can do that according to the RFC. - fixes #783
This commit is contained in:
committed by
Michał Zieliński
parent
be5e13671c
commit
0420c8c363
@@ -220,9 +220,8 @@ proc parseResponse(s: TSocket, getBody: bool, timeout: int): TResponse =
|
||||
inc(linei, le)
|
||||
if line[linei] != ':': httpError("invalid headers")
|
||||
inc(linei) # Skip :
|
||||
linei += skipWhitespace(line, linei)
|
||||
|
||||
result.headers[name] = line[linei.. -1]
|
||||
result.headers[name] = line[linei.. -1].strip()
|
||||
if not fullyRead:
|
||||
httpError("Connection was closed before full request has been made")
|
||||
if getBody:
|
||||
|
||||
Reference in New Issue
Block a user