Fix Build
publish / publish (push) Failing after 11m28s

This commit is contained in:
khodowany
2026-10-06 00:14:18 -05:00
parent bff6884c09
commit 7a86cedeb3
+8 -3
View File
@@ -2298,15 +2298,20 @@ BOOST_AUTO_TEST_CASE(ligo_http_raw_exchange_headers_query_and_status) {
BOOST_REQUIRE(server.start());
auto exercise = [&]() -> boost::asio::awaitable<void> {
auto client = ligo::http::client{{"127.0.0.1", server.selected_port()}};
auto result = co_await client.exchange({.method = ligo::http::method::GET, .target = "/raw?search=two+words%2B", .headers = {{"If-None-Match", "revision-one"}}});
// GCC 12 can ICE on initializer-list temporaries in co_await expressions.
auto request = ligo::http::request{.method = ligo::http::method::GET, .target = "/raw?search=two+words%2B"};
request.headers.emplace("If-None-Match", "revision-one");
auto result = co_await client.exchange(request);
BOOST_REQUIRE(result);
BOOST_CHECK_EQUAL(result->status, 202);
BOOST_CHECK_EQUAL(result->body, "not a JSON envelope");
BOOST_CHECK_EQUAL(result->headers.at("etag"), "revision-two");
auto invalid = co_await client.exchange({.method = ligo::http::method::GET, .target = "/raw?search=%ZZ"});
auto invalid_request = ligo::http::request{.method = ligo::http::method::GET, .target = "/raw?search=%ZZ"};
auto invalid = co_await client.exchange(invalid_request);
BOOST_REQUIRE(invalid);
BOOST_CHECK_EQUAL(invalid->status, 400);
auto duplicate = co_await client.exchange({.method = ligo::http::method::GET, .target = "/raw?x=1&x=2"});
auto duplicate_request = ligo::http::request{.method = ligo::http::method::GET, .target = "/raw?x=1&x=2"};
auto duplicate = co_await client.exchange(duplicate_request);
BOOST_REQUIRE(duplicate);
BOOST_CHECK_EQUAL(duplicate->status, 400);
server.stop();