mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-06 11:54:11 +00:00
Allow customize Host header
This commit is contained in:
committed by
Dominik Picheta
parent
b67dea7a33
commit
21ea1094ef
@@ -450,10 +450,11 @@ proc generateHeaders(requestUrl: Uri, httpMethod: string,
|
||||
result.add(" HTTP/1.1\c\L")
|
||||
|
||||
# Host header.
|
||||
if requestUrl.port == "":
|
||||
add(result, "Host: " & requestUrl.hostname & "\c\L")
|
||||
else:
|
||||
add(result, "Host: " & requestUrl.hostname & ":" & requestUrl.port & "\c\L")
|
||||
if not headers.hasKey("Host"):
|
||||
if requestUrl.port == "":
|
||||
add(result, "Host: " & requestUrl.hostname & "\c\L")
|
||||
else:
|
||||
add(result, "Host: " & requestUrl.hostname & ":" & requestUrl.port & "\c\L")
|
||||
|
||||
# Connection header.
|
||||
if not headers.hasKey("Connection"):
|
||||
|
||||
Reference in New Issue
Block a user