Allow customize Host header
This commit is contained in:
parent
b67dea7a33
commit
21ea1094ef
1 changed files with 5 additions and 4 deletions
|
|
@ -450,10 +450,11 @@ proc generateHeaders(requestUrl: Uri, httpMethod: string,
|
||||||
result.add(" HTTP/1.1\c\L")
|
result.add(" HTTP/1.1\c\L")
|
||||||
|
|
||||||
# Host header.
|
# Host header.
|
||||||
if requestUrl.port == "":
|
if not headers.hasKey("Host"):
|
||||||
add(result, "Host: " & requestUrl.hostname & "\c\L")
|
if requestUrl.port == "":
|
||||||
else:
|
add(result, "Host: " & requestUrl.hostname & "\c\L")
|
||||||
add(result, "Host: " & requestUrl.hostname & ":" & requestUrl.port & "\c\L")
|
else:
|
||||||
|
add(result, "Host: " & requestUrl.hostname & ":" & requestUrl.port & "\c\L")
|
||||||
|
|
||||||
# Connection header.
|
# Connection header.
|
||||||
if not headers.hasKey("Connection"):
|
if not headers.hasKey("Connection"):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue