diff --git a/examples/example_guestbook.cpp b/examples/example_guestbook.cpp index 453cd2c..aa16022 100644 --- a/examples/example_guestbook.cpp +++ b/examples/example_guestbook.cpp @@ -17,7 +17,7 @@ struct RouteContext { template<> struct asyncgi::config::RouteMatcher { - bool operator()(AccessRole value, const asyncgi::Request&, asyncgi::Response&, RouteContext& context) const + bool operator()(AccessRole value, const asyncgi::Request&, const RouteContext& context) const { return value == context.role; } diff --git a/examples/example_route_matcher.cpp b/examples/example_route_matcher.cpp index 9361a66..122a058 100644 --- a/examples/example_route_matcher.cpp +++ b/examples/example_route_matcher.cpp @@ -51,7 +51,7 @@ struct LoginPageAuthorize { template<> struct asyncgi::config::RouteMatcher { - bool operator()(AccessRole value, const asyncgi::Request&, asyncgi::Response&, RouteContext& context) const + bool operator()(AccessRole value, const asyncgi::Request&, const RouteContext& context) const { return value == context.role; } diff --git a/include/asyncgi/router.h b/include/asyncgi/router.h index 058d24c..271c6e3 100755 --- a/include/asyncgi/router.h +++ b/include/asyncgi/router.h @@ -113,7 +113,7 @@ class Router : public whaleroute::RequestRouter struct config::RouteMatcher { - bool operator()(asyncgi::http::RequestMethod value, const asyncgi::Request& request, asyncgi::Response&) const + bool operator()(asyncgi::http::RequestMethod value, const asyncgi::Request& request) const { return value == request.method(); } @@ -121,8 +121,7 @@ struct config::RouteMatcher { template struct config::RouteMatcher { - bool operator()(asyncgi::http::RequestMethod value, const asyncgi::Request& request, asyncgi::Response&, TContext&) - const + bool operator()(asyncgi::http::RequestMethod value, const asyncgi::Request& request, const TContext&) const { return value == request.method(); }