diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2021-09-01 19:09:50 -0400 |
---|---|---|
committer | Ashod Nakashian <Ashod@users.noreply.github.com> | 2021-09-13 09:40:09 -0400 |
commit | 24acdaf89b3a0616618efeaf68917d4bd51c4d46 (patch) | |
tree | 0a061ec4badf3051e5593926ced82ca05c954c62 /net | |
parent | wsd: configuration setting to control embedded-url hexifying (diff) | |
download | online-24acdaf89b3a0616618efeaf68917d4bd51c4d46.tar.gz online-24acdaf89b3a0616618efeaf68917d4bd51c4d46.zip |
wsd: throw when an invalid URL is used to create an http session
Change-Id: I2d2eb90badf4f02ec4f2e4c4071fc76b23a92928
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit c16ad4447004a72226df7761fb377014c242ea4e)
Diffstat (limited to 'net')
-rw-r--r-- | net/HttpRequest.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/HttpRequest.cpp b/net/HttpRequest.cpp index 26e48ac44a..b00d45a847 100644 --- a/net/HttpRequest.cpp +++ b/net/HttpRequest.cpp @@ -17,6 +17,7 @@ #include <fstream> #include <memory> #include <sstream> +#include <stdexcept> #include <string> #include <sys/types.h> #include <netdb.h> @@ -652,7 +653,7 @@ std::shared_ptr<Session> Session::create(std::string host, Protocol protocol, in if (!net::parseUri(host, scheme, hostname, portString)) { LOG_ERR("Invalid URI [" << host << "] to http::Session::create."); - return nullptr; + throw std::runtime_error("Invalid URI [" + host + "] to http::Session::create."); } scheme = Util::toLower(std::move(scheme)); |