Merge pull request #5473 from raydf/devel

Only remove scheme when there's a TLS request ("https")
This commit is contained in:
Dominik Picheta
2017-03-03 19:52:47 +00:00
committed by GitHub

View File

@@ -719,9 +719,9 @@ proc generateHeaders(requestUrl: Uri, httpMethod: string,
if requestUrl.query.len > 0:
result.add("?" & requestUrl.query)
else:
# Remove the 'http://' from the URL for CONNECT requests.
# Remove the 'http://' from the URL for CONNECT requests for TLS connections.
var modifiedUrl = requestUrl
modifiedUrl.scheme = ""
if requestUrl.scheme == "https": modifiedUrl.scheme = ""
result.add($modifiedUrl)
# HTTP/1.1\c\l