File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -9942,6 +9942,37 @@ TEST(RedirectTest, RedirectToUrlWithQueryParameters) {
99429942 }
99439943}
99449944
9945+ TEST (RedirectTest, RedirectToUrlWithPlusInQueryParameters) {
9946+ Server svr;
9947+
9948+ svr.Get (" /" , [](const Request & /* req*/ , Response &res) {
9949+ res.set_redirect (R"( /hello?key=AByz09+~-._%20%26%3F%C3%BC%2B)" );
9950+ });
9951+
9952+ svr.Get (" /hello" , [](const Request &req, Response &res) {
9953+ res.set_content (req.get_param_value (" key" ), " text/plain" );
9954+ });
9955+
9956+ auto thread = std::thread ([&]() { svr.listen (HOST, PORT); });
9957+ auto se = detail::scope_exit ([&] {
9958+ svr.stop ();
9959+ thread.join ();
9960+ ASSERT_FALSE (svr.is_running ());
9961+ });
9962+
9963+ svr.wait_until_ready ();
9964+
9965+ {
9966+ Client cli (HOST, PORT);
9967+ cli.set_follow_location (true );
9968+
9969+ auto res = cli.Get (" /" );
9970+ ASSERT_TRUE (res);
9971+ EXPECT_EQ (StatusCode::OK_200, res->status );
9972+ EXPECT_EQ (" AByz09 ~-._ &?ü+" , res->body );
9973+ }
9974+ }
9975+
99459976TEST (VulnerabilityTest, CRLFInjection) {
99469977 Server svr;
99479978
You can’t perform that action at this time.
0 commit comments