mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-04 20:17:42 +00:00
Only remove scheme when there's a TLS request ("https")
If condition, for not removing the scheme when proxied connection isn't a TLS request ("http://...").
This commit is contained in:
committed by
GitHub
parent
5d125ca716
commit
d5d975ceef
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user