From e015ec3f3fa9ebc8bc78081b28f82f6d914830dc Mon Sep 17 00:00:00 2001 From: tastytea Date: Thu, 8 Aug 2019 21:25:28 +0200 Subject: [PATCH] Don't crash if protocol is missing / not known. --- src/lib/uri.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/uri.cpp b/src/lib/uri.cpp index 25d3e86..da8100d 100644 --- a/src/lib/uri.cpp +++ b/src/lib/uri.cpp @@ -152,6 +152,10 @@ namespace remwharead session = make_unique(poco_uri.getHost(), poco_uri.getPort()); } + else + { + throw Poco::Exception("Protocol not supported."); + } HTTPRequest request(method, path, HTTPMessage::HTTP_1_1); request.set("User-Agent", string("remwharead/") + global::version);