Merge pull request #788 from zielmicha/httpclient-fix

httpclient: strip trailing whitespace from headers.
This commit is contained in:
Dominik Picheta
2013-12-30 09:13:18 -08:00

View File

@@ -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: