Skip to content

Commit

Permalink
fixup! URI-encoding when redirecting legacy URLs to /content
Browse files Browse the repository at this point in the history
The alleged bug seems rather an issue with httplib which seems to
URI-encode any + present in query parameters.
  • Loading branch information
veloman-yunkan committed Feb 9, 2023
1 parent c2fffac commit 51206f4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down

0 comments on commit 51206f4

Please sign in to comment.