From: Mikko Rasa Date: Mon, 23 Sep 2019 11:42:04 +0000 (+0300) Subject: Allow the query part of a URL to be empty X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=9a4e72786cb5026fe80a16337f5b916310c7a562;p=libs%2Fnet.git Allow the query part of a URL to be empty This can happen when submitting an empty form with the GET method. --- diff --git a/source/http/utils.cpp b/source/http/utils.cpp index 41fabef..e52309a 100644 --- a/source/http/utils.cpp +++ b/source/http/utils.cpp @@ -79,7 +79,7 @@ string urldecode(const string &str) Url parse_url(const string &str) { - static Regex r_url("^(([a-z]+)://)?([a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*(:[0-9]+)?)?(/[^?#]*)?(\\?([^#]+))?(#(.*))?$"); + static Regex r_url("^(([a-z]+)://)?([a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*(:[0-9]+)?)?(/[^?#]*)?(\\?([^#]*))?(#(.*))?$"); if(RegMatch m = r_url.match(str)) { Url url;