@@ -419,18 +419,18 @@ TEST_SUITE("[MESSAGE]")
419419 http::request req0;
420420 req0.verb = http::METHOD_GET;
421421 req0.uri = " /path/to/resource/with+spaces" ;
422- req0.add_header (http::host, " www.example.com:8080" );
423- req0.add_header (http::user_agent, " CustomTestAgent/7.4.2 (compatible; FancyBot/1.0; +https://example.com/bot)" );
424- req0.add_header (http::accept, " text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" );
425- req0.add_header (http::accept_language, " en-US,en;q=0.5" );
426- req0.add_header (http::accept_encoding, " gzip, deflate, br" );
427- req0.add_header (http::connection, " keep-alive, Upgrade" );
428- req0.add_header (http::upgrade, " websocket" );
429- req0.add_header (http::sec_websocket_key, " x3JJHMbDL1EzLkh9GBhXDw==" );
430- req0.add_header (http::sec_websocket_version, " 13" );
431- req0.add_header (http::cache_control, " no-cache, no-store, must-revalidate" );
432- req0.add_header (http::pragma, " no-cache" );
433- req0.add_header (http::content_type, " application/json; charset=\" utf-8\" " );
422+ req0.headers . add (http::host, " www.example.com:8080" );
423+ req0.headers . add (http::user_agent, " CustomTestAgent/7.4.2 (compatible; FancyBot/1.0; +https://example.com/bot)" );
424+ req0.headers . add (http::accept, " text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" );
425+ req0.headers . add (http::accept_language, " en-US,en;q=0.5" );
426+ req0.headers . add (http::accept_encoding, " gzip, deflate, br" );
427+ req0.headers . add (http::connection, " keep-alive, Upgrade" );
428+ req0.headers . add (http::upgrade, " websocket" );
429+ req0.headers . add (http::sec_websocket_key, " x3JJHMbDL1EzLkh9GBhXDw==" );
430+ req0.headers . add (http::sec_websocket_version, " 13" );
431+ req0.headers . add (http::cache_control, " no-cache, no-store, must-revalidate" );
432+ req0.headers . add (http::pragma, " no-cache" );
433+ req0.headers . add (http::content_type, " application/json; charset=\" utf-8\" " );
434434 req0.content = " {\" message\" : \" This is a test body with some content.\" }" ;
435435 req0.params .push_back ({" q" , " search term" });
436436 req0.params .push_back ({" empty" , " " });
@@ -494,8 +494,10 @@ TEST_SUITE("[MESSAGE]")
494494 REQUIRE (req0.headers .size () == req1.headers .size ());
495495 for (size_t i = 0 ; i < req0.headers .size () ; ++i)
496496 {
497- REQUIRE (req0.headers [i].key == req1.headers [i].key );
498- REQUIRE (req0.headers [i].value == req1.headers [i].value );
497+ const auto [key0, val0] = req0.headers [i];
498+ const auto [key1, val1] = req1.headers [i];
499+ REQUIRE (key0 == key1);
500+ REQUIRE (val0 == val1);
499501 }
500502 REQUIRE (req0.content == req1.content );
501503 }
@@ -504,9 +506,9 @@ TEST_SUITE("[MESSAGE]")
504506 {
505507 http::response resp0;
506508 resp0.status = http::ok;
507- resp0.add_header (http::date, " Sat, 07 Jun 2025 11:34:29 GMT" );
508- resp0.add_header (http::content_type, " application/json" );
509- resp0.add_header (http::set_cookie, " sails.sid=s%3AzNjVxqbbKjdhW62QxWPrO9_s7iw6gFfj.YkpdH7mCTkx%2FC%2BgLXyBzXETRD7gKyFu%2BKWMS43uKq4Y; Path=/; HttpOnly" );
509+ resp0.headers . add (http::date, " Sat, 07 Jun 2025 11:34:29 GMT" );
510+ resp0.headers . add (http::content_type, " application/json" );
511+ resp0.headers . add (http::set_cookie, " sails.sid=s%3AzNjVxqbbKjdhW62QxWPrO9_s7iw6gFfj.YkpdH7mCTkx%2FC%2BgLXyBzXETRD7gKyFu%2BKWMS43uKq4Y; Path=/; HttpOnly" );
510512
511513 // Serialize
512514 std::error_code ec{};
@@ -558,8 +560,10 @@ TEST_SUITE("[MESSAGE]")
558560 REQUIRE (resp0.headers .size () == resp1.headers .size ());
559561 for (size_t i = 0 ; i < resp0.headers .size () ; ++i)
560562 {
561- REQUIRE (resp0.headers [i].key == resp1.headers [i].key );
562- REQUIRE (resp0.headers [i].value == resp1.headers [i].value );
563+ const auto [key0, val0] = resp0.headers [i];
564+ const auto [key1, val1] = resp1.headers [i];
565+ REQUIRE (key0 == key1);
566+ REQUIRE (val0 == val1);
563567 }
564568 REQUIRE (resp0.content_str == resp1.content_str );
565569 }
0 commit comments