From 9a4e72786cb5026fe80a16337f5b916310c7a562 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 23 Sep 2019 14:42:04 +0300 Subject: [PATCH] Allow the query part of a URL to be empty This can happen when submitting an empty form with the GET method. --- source/http/utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.43.0