mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
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:
@ -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;
|
||||
|
Reference in New Issue
Block a user