From 0420c8c363a755486d6ef8f822b33e5a0f75cb4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zieli=C5=84ski?= Date: Sat, 28 Dec 2013 17:07:52 +0100 Subject: [PATCH] httpclient: strip trailing whitespace from headers. - we can do that according to the RFC. - fixes #783 --- lib/pure/httpclient.nim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/pure/httpclient.nim b/lib/pure/httpclient.nim index 2c0e7b8351..bb9835fe78 100644 --- a/lib/pure/httpclient.nim +++ b/lib/pure/httpclient.nim @@ -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: