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
This commit is contained in:
David Krause
2018-10-27 22:54:45 +02:00
committed by Dominik Picheta
parent 4362ba7293
commit f2cd8ed99a

View File

@@ -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: