diff options
author | Dominik Picheta <dominikpicheta@googlemail.com> | 2015-08-01 20:55:46 +0100 |
---|---|---|
committer | Dominik Picheta <dominikpicheta@googlemail.com> | 2015-08-01 20:55:46 +0100 |
commit | e205a9e3af57a09fa4585a5b2dc7ae6178fe53df (patch) | |
tree | 27dd23c41c56a60a5931f7f63ee5e41dd6db9490 | |
parent | 92ca736f0ac2e3b8c66516fb22ce8c5fbdac69d5 (diff) | |
parent | 9dde0ae3ac6c97704f64e0dee0d55c1a49faaf4b (diff) | |
download | Nim-e205a9e3af57a09fa4585a5b2dc7ae6178fe53df.tar.gz |
Merge pull request #3170 from jonathonf/patch-2
Set correct Host in request header
-rw-r--r-- | lib/pure/httpclient.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pure/httpclient.nim b/lib/pure/httpclient.nim index e6b8088c5..98687359b 100644 --- a/lib/pure/httpclient.nim +++ b/lib/pure/httpclient.nim @@ -402,7 +402,7 @@ proc request*(url: string, httpMethod: string, extraHeaders = "", headers.add(" HTTP/1.1\c\L") - add(headers, "Host: " & r.hostname & "\c\L") + add(headers, "Host: " & parseUri(url).hostname & "\c\L") if userAgent != "": add(headers, "User-Agent: " & userAgent & "\c\L") if proxy != nil and proxy.auth != "": |