Merge pull request #3170 from jonathonf/patch-2
Set correct Host in request header
This commit is contained in:
commit
e205a9e3af
1 changed files with 1 additions and 1 deletions
|
|
@ -402,7 +402,7 @@ proc request*(url: string, httpMethod: string, extraHeaders = "",
|
||||||
|
|
||||||
headers.add(" HTTP/1.1\c\L")
|
headers.add(" HTTP/1.1\c\L")
|
||||||
|
|
||||||
add(headers, "Host: " & r.hostname & "\c\L")
|
add(headers, "Host: " & parseUri(url).hostname & "\c\L")
|
||||||
if userAgent != "":
|
if userAgent != "":
|
||||||
add(headers, "User-Agent: " & userAgent & "\c\L")
|
add(headers, "User-Agent: " & userAgent & "\c\L")
|
||||||
if proxy != nil and proxy.auth != "":
|
if proxy != nil and proxy.auth != "":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue