From e585a7a5bc9084fd587a2dbdad652dadc14adc39 Mon Sep 17 00:00:00 2001 From: ProTrack Date: Mon, 27 Feb 2017 10:13:33 +0200 Subject: [PATCH] If query string is present then cut it from the reqeust path so find resource won't fail --- server_http.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server_http.hpp b/server_http.hpp index f27fa33..2ec427a 100644 --- a/server_http.hpp +++ b/server_http.hpp @@ -331,12 +331,13 @@ namespace SimpleWeb { auto qs_begin = REGEX_NS::sregex_token_iterator(qs.begin(), qs.end(), pattern, submatches); auto qs_end = REGEX_NS::sregex_token_iterator(); - for (auto i = qs_begin; i != qs_end; i++) + for (auto it = qs_begin; it != qs_end; it++) { - std::string key = i->str(); - std::string value = (++i)->str(); + std::string key = it->str(); + std::string value = (++it)->str(); request->query_string.emplace(std::make_pair(key, value)); } + request->path = request->path.substr(0, qs_start); } size_t protocol_end;