diff --git a/lib/http_parser.cpp b/lib/http_parser.cpp index 41b69d5b..6f1caee9 100644 --- a/lib/http_parser.cpp +++ b/lib/http_parser.cpp @@ -131,7 +131,7 @@ HTTP::URL::URL(const std::string &url){ } } // if the host is numeric, assume it is a port, instead - if (is_numeric(host.c_str())){ + if (host.size() && is_numeric(host.c_str())){ port = host; host = ""; }