summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@googlemail.com>2017-03-03 19:52:47 +0000
committerGitHub <noreply@github.com>2017-03-03 19:52:47 +0000
commit52462f031e6f8605fc3155879c216e25427ca7df (patch)
treef0a4933ff6202ee6a22a1173646a351733c6c076 /lib
parent5d125ca716b83abd850a5f270085a755dbd4c80c (diff)
parentd5d975ceef2bbed02629123c110076f5617f5671 (diff)
downloadNim-52462f031e6f8605fc3155879c216e25427ca7df.tar.gz
Merge pull request #5473 from raydf/devel
Only remove scheme when there's a TLS request ("https")
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/httpclient.nim4
1 files 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