From: Thomas Geymayer Date: Sun, 13 Oct 2013 10:06:17 +0000 (+0200) Subject: HTTP: check url for scheme and report instead of failing with assert. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8e75c6be5047bdb0deacc385decc4ff4187c4990;p=simgear.git HTTP: check url for scheme and report instead of failing with assert. --- diff --git a/simgear/io/HTTPClient.cxx b/simgear/io/HTTPClient.cxx index b34cfd4e..8b4b2594 100644 --- a/simgear/io/HTTPClient.cxx +++ b/simgear/io/HTTPClient.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -666,6 +667,9 @@ void Client::update(int waitTimeout) void Client::makeRequest(const Request_ptr& r) { + if( r->url().find("://") == std::string::npos ) + throw std::runtime_error("Unable to parse URL (missing scheme)"); + string host = r->host(); int port = r->port(); if (!d->proxy.empty()) {