If query string is present then cut it from the reqeust path so find resource won't fail
This commit is contained in:
parent
d554c13db5
commit
e585a7a5bc
1 changed files with 4 additions and 3 deletions
|
|
@ -331,12 +331,13 @@ namespace SimpleWeb {
|
||||||
auto qs_begin = REGEX_NS::sregex_token_iterator(qs.begin(), qs.end(), pattern, submatches);
|
auto qs_begin = REGEX_NS::sregex_token_iterator(qs.begin(), qs.end(), pattern, submatches);
|
||||||
auto qs_end = REGEX_NS::sregex_token_iterator();
|
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 key = it->str();
|
||||||
std::string value = (++i)->str();
|
std::string value = (++it)->str();
|
||||||
request->query_string.emplace(std::make_pair(key, value));
|
request->query_string.emplace(std::make_pair(key, value));
|
||||||
}
|
}
|
||||||
|
request->path = request->path.substr(0, qs_start);
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t protocol_end;
|
size_t protocol_end;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue