summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorDavid Krause <enthus1ast@users.noreply.github.com>2018-10-27 22:54:45 +0200
committerDominik Picheta <dominikpicheta@googlemail.com>2018-10-27 21:54:45 +0100
commitf2cd8ed99a7caa00b20bae2443cacf2d97700d75 (patch)
treed5c2c2f3ea519330bc8c04951ff68203b2a458d2 /lib
parent4362ba7293e7527ff57f69bf2a0e95fdfd84985e (diff)
downloadNim-f2cd8ed99a7caa00b20bae2443cacf2d97700d75.tar.gz
fixes #7842 if no uri.scheme specified raise ValueError with hint (#7846)
* fixes #7842 if no uri.scheme specified on request rais ValueError with hint

Signed-off-by: enthus1ast <david@code0.xyz>

* Update httpclient.nim
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/httpclient.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/pure/httpclient.nim b/lib/pure/httpclient.nim
index 139d4bb50..e4614bd0f 100644
--- a/lib/pure/httpclient.nim
+++ b/lib/pure/httpclient.nim
@@ -1163,6 +1163,9 @@ proc requestAux(client: HttpClient | AsyncHttpClient, url: string,
                 {.multisync.} =
   # Helper that actually makes the request. Does not handle redirects.
   let requestUrl = parseUri(url)
+  
+  if requestUrl.scheme == "":
+    raise newException(ValueError, "No uri scheme supplied.")
 
   when client is AsyncHttpClient:
     if not client.parseBodyFut.isNil: