diff options
author | Simon Hafner <hafnersimon@gmail.com> | 2015-04-01 06:33:24 +0500 |
---|---|---|
committer | Simon Hafner <hafnersimon@gmail.com> | 2015-04-01 06:33:24 +0500 |
commit | a339cb5ed5e2389ad77ee05d2e553cbf43f279b2 (patch) | |
tree | 91182bc92f2421f95e618fdc2d0375022f3839eb /lib/pure/httpclient.nim | |
parent | 06b7892ed0878f06c54fa178a07d9844b4fa760f (diff) | |
parent | 165619552a7ad0fa4f594963ee0441dd711edfd4 (diff) | |
download | Nim-a339cb5ed5e2389ad77ee05d2e553cbf43f279b2.tar.gz |
Merge branch 'devel' into jpoirier-realtimeGCTest
Diffstat (limited to 'lib/pure/httpclient.nim')
-rw-r--r-- | lib/pure/httpclient.nim | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/pure/httpclient.nim b/lib/pure/httpclient.nim index f11101511..4c2580da0 100644 --- a/lib/pure/httpclient.nim +++ b/lib/pure/httpclient.nim @@ -227,7 +227,7 @@ proc parseResponse(s: Socket, getBody: bool, timeout: int): Response = inc(linei, le) # Status code linei.inc skipWhitespace(line, linei) - result.status = line[linei .. -1] + result.status = line[linei .. ^1] parsedStatus = true else: # Parse headers @@ -238,7 +238,7 @@ proc parseResponse(s: Socket, getBody: bool, timeout: int): Response = if line[linei] != ':': httpError("invalid headers") inc(linei) # Skip : - result.headers[name] = line[linei.. -1].strip() + result.headers[name] = line[linei.. ^1].strip() if not fullyRead: httpError("Connection was closed before full request has been made") if getBody: @@ -442,7 +442,7 @@ proc request*(url: string, httpMethod = httpGET, extraHeaders = "", ## | Extra headers can be specified and must be separated by ``\c\L`` ## | An optional timeout can be specified in miliseconds, if reading from the ## server takes longer than specified an ETimeout exception will be raised. - result = request(url, $httpMethod, extraHeaders, body, sslContext, timeout, + result = request(url, $httpMethod, extraHeaders, body, sslContext, timeout, userAgent, proxy) proc redirection(status: string): bool = @@ -725,7 +725,7 @@ proc parseResponse(client: AsyncHttpClient, inc(linei, le) # Status code linei.inc skipWhitespace(line, linei) - result.status = line[linei .. -1] + result.status = line[linei .. ^1] parsedStatus = true else: # Parse headers @@ -736,7 +736,7 @@ proc parseResponse(client: AsyncHttpClient, if line[linei] != ':': httpError("invalid headers") inc(linei) # Skip : - result.headers[name] = line[linei.. -1].strip() + result.headers[name] = line[linei.. ^1].strip() if not fullyRead: httpError("Connection was closed before full request has been made") if getBody: |