Skip to content

Commit ee421d6

Browse files
Exit early for requests with no route for optional too
1 parent 6d83f6d commit ee421d6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

include/crow/http_connection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ namespace crow
113113
{
114114
routing_handle_result_ = handler_->handle_initial(req_, res);
115115
// if no route is found for the request method, return the response without parsing or processing anything further.
116-
if (!routing_handle_result_->rule_index && !routing_handle_result_->catch_all && req_.method != HTTPMethod::Options)
116+
if (!routing_handle_result_->rule_index && !routing_handle_result_->catch_all && (req_.method != HTTPMethod::Options || routing_handle_result_->method == HTTPMethod::InternalMethodCount))
117117
{
118118
parser_.done();
119119
need_to_call_after_handlers_ = true;

0 commit comments

Comments
 (0)