]> git.mxchange.org Git - simgear.git/commitdiff
HTTP: check url for scheme and report instead of failing with assert.
authorThomas Geymayer <tomgey@gmail.com>
Sun, 13 Oct 2013 10:06:17 +0000 (12:06 +0200)
committerThomas Geymayer <tomgey@gmail.com>
Sun, 13 Oct 2013 10:06:17 +0000 (12:06 +0200)
simgear/io/HTTPClient.cxx

index b34cfd4eb94c50824174d2b25afa1f51c065fb55..8b4b25941bded817096a6323cd02e8d5beba4ffe 100644 (file)
@@ -30,6 +30,7 @@
 #include <iostream>
 #include <errno.h>
 #include <map>
+#include <stdexcept>
 
 #include <boost/foreach.hpp>
 #include <boost/algorithm/string/case_conv.hpp>
@@ -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()) {