From d5d975ceef2bbed02629123c110076f5617f5671 Mon Sep 17 00:00:00 2001 From: Rayner De Los Santos F Date: Fri, 3 Mar 2017 08:47:13 -0400 Subject: 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://..."). --- lib/pure/httpclient.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pure/httpclient.nim b/lib/pure/httpclient.nim index 662e75471..7f666fb35 100644 --- a/lib/pure/httpclient.nim +++ b/lib/pure/httpclient.nim @@ -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 -- cgit 1.4.1-2-gfad0