Skip to content

Commit

Permalink
Minor test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitriy Zaytsev committed Jan 16, 2025
1 parent 8f71a61 commit b1aea20
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1960,6 +1960,10 @@ TEST_CASE("middleware_cors")
return "-";
});

CROW_ROUTE(app, "/auth-origin").methods(crow::HTTPMethod::Post)([&](const request&) {
return "-";
});

CROW_ROUTE(app, "/expose")
([&](const request&) {
return "-";
Expand All @@ -1970,6 +1974,8 @@ TEST_CASE("middleware_cors")
return "-";
});



const auto port = 33333;
auto _ = app.bindaddr(LOCALHOST_ADDRESS).port(port).run_async();
app.wait_for_server_start();
Expand All @@ -1992,7 +1998,7 @@ TEST_CASE("middleware_cors")
CHECK(resp.find("Access-Control-Allow-Credentials: true") != std::string::npos);

resp = HttpClient::request(LOCALHOST_ADDRESS, port,
"OPTION /auth-origin\r\nOrigin: test-client\r\n\r\n");
"OPTIONS /auth-origin / HTTP/1.1 \r\n\r\n");
CHECK(resp.find("Access-Control-Allow-Origin: *") != std::string::npos);
CHECK(resp.find("Access-Control-Allow-Credentials: true") == std::string::npos);

Expand Down

0 comments on commit b1aea20

Please sign in to comment.