httpclient: strip trailing whitespace from headers.
- we can do that according to the RFC. - fixes #783
This commit is contained in:
parent
be5e13671c
commit
0420c8c363
1 changed files with 1 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue