Skip to content

Commit

Permalink
Only remove scheme when there's a TLS request ("https")
Browse files Browse the repository at this point in the history
If condition, for not removing the scheme when proxied connection isn't a TLS request ("http://...").
Rayner De Los Santos F authored Mar 3, 2017
1 parent 5d125ca commit d5d975c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/pure/httpclient.nim
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d5d975c

Please sign in to comment.