diff --git a/lib/pure/httpclient.nim b/lib/pure/httpclient.nim index 662e7547148e..7f666fb35755 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