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
commit f2cd8ed99a

View file

@ -1164,6 +1164,9 @@ proc requestAux(client: HttpClient | AsyncHttpClient, url: string,
# Helper that actually makes the request. Does not handle redirects. # Helper that actually makes the request. Does not handle redirects.
let requestUrl = parseUri(url) let requestUrl = parseUri(url)
if requestUrl.scheme == "":
raise newException(ValueError, "No uri scheme supplied.")
when client is AsyncHttpClient: when client is AsyncHttpClient:
if not client.parseBodyFut.isNil: if not client.parseBodyFut.isNil:
# let the current operation finish before making another request # let the current operation finish before making another request