URI-encoding when redirecting legacy URLs to /content

Testing of this functionality revealed that the query part containing +
symbols (as replacement for spaces in the parameter values) isn't
forwarded properly as the + symbols are URI-encoded (this is a bug on
the part of the `RequestContext::get_query()` the result of which
already contains URI-encoded +'s).
This commit is contained in:
Veloman Yunkan
2023-02-08 17:31:59 +01:00
parent 58bb8b9843
commit a807ce27f1
2 changed files with 14 additions and 1 deletions

View File

@ -607,7 +607,7 @@ std::unique_ptr<Response> InternalServer::handle_request(const RequestContext& r
if (isEndpointUrl(url, "catch"))
return handle_catch(request);
std::string contentUrl = m_root + "/content" + url;
std::string contentUrl = urlEncode(m_root + "/content" + url);
const std::string query = request.get_query();
if ( ! query.empty() )
contentUrl += "?" + query;