From 51206f40375dc5f76cbb8bf07ec9a43639cad7ba Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Thu, 9 Feb 2023 11:03:48 +0100 Subject: [PATCH] fixup! URI-encoding when redirecting legacy URLs to /content The alleged bug seems rather an issue with httplib which seems to URI-encode any + present in query parameters. --- test/server.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/server.cpp b/test/server.cpp index 420c8986..c99e960e 100644 --- a/test/server.cpp +++ b/test/server.cpp @@ -1321,8 +1321,11 @@ TEST_F(ServerTest, NonEndpointUrlsAreRedirectedToContentUrls) // Make sure that URI-encoded query stays URI-encoded "/encode?string=%23%25%26%2B%3D%3F", - // Bug: the + symbol (that replaces space) in the query gets URI-encoded + // There seems to be a bug in httplib client - the '+' symbols + // in query parameters are URI encoded. Therefore using %20 (a URI-encoded + // space) instead. //"/route?from=current+location&to=girlfriend%238", + "/route?from=current%20location&to=girlfriend%238", }; for ( const std::string& p : paths )