Merge pull request #3170 from jonathonf/patch-2

Set correct Host in request header
This commit is contained in:
Dominik Picheta
2015-08-01 20:55:46 +01:00

View File

@@ -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 != "":