From 8e75c6be5047bdb0deacc385decc4ff4187c4990 Mon Sep 17 00:00:00 2001 From: Thomas Geymayer Date: Sun, 13 Oct 2013 12:06:17 +0200 Subject: [PATCH] HTTP: check url for scheme and report instead of failing with assert. --- simgear/io/HTTPClient.cxx | 4 ++++ 1 file changed, 4 insertions(+) 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()) { -- 2.39.5