Skip to content

Commit

Permalink
Bug in method_not_allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
anarthal committed Dec 16, 2024
1 parent 8793f30 commit 7b58088
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion example/3_advanced/http_server_cpp20/handle_request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ asio::awaitable<http::response<http::string_body>> orders::handle_request(
auto it3 = std::find_if(it1, it2, [&request](const std::pair<std::string_view, http_endpoint>& ep) {
return ep.second.method == request.method();
});
if (it3 == endpoints.end())
if (it3 == it2)
co_return error_response(http::status::method_not_allowed, "Unsupported HTTP method");

// Compose the data struct (TODO)
Expand Down

0 comments on commit 7b58088

Please sign in to comment.