diff options
author | Michał Zieliński <michal@zielinscy.org.pl> | 2013-12-28 17:07:52 +0100 |
---|---|---|
committer | Michał Zieliński <michal+asus@zielinscy.org.pl> | 2013-12-28 17:26:08 +0100 |
commit | 0420c8c363a755486d6ef8f822b33e5a0f75cb4b (patch) | |
tree | f45d7ef24fd104f6f952d290fba15bd8b932d13f /lib/pure/httpclient.nim | |
parent | be5e13671cdd923953d7b1b2137f06673fe7bb96 (diff) | |
download | Nim-0420c8c363a755486d6ef8f822b33e5a0f75cb4b.tar.gz |
httpclient: strip trailing whitespace from headers.
- we can do that according to the RFC. - fixes #783
Diffstat (limited to 'lib/pure/httpclient.nim')
-rw-r--r-- | lib/pure/httpclient.nim | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/pure/httpclient.nim b/lib/pure/httpclient.nim index 2c0e7b835..bb9835fe7 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: |