From 254b74282e30688dab521f6588cd88991f5bb68f Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Fri, 11 Mar 2022 18:41:06 +0100 Subject: [PATCH] Make `process_simple_route` async --- src/server.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server.rs b/src/server.rs index a4ed2d3..4ac8bd2 100644 --- a/src/server.rs +++ b/src/server.rs @@ -202,7 +202,7 @@ impl FromRequest for CustomRequest { } /// Process a "simple request" aka not a WebSocket request -fn process_simple_route(route: &Route, req: &mut HttpRequestHandler) -> RequestResult { +async fn process_simple_route(route: &Route, req: &mut HttpRequestHandler) -> RequestResult { if requests_limit_helper::trigger_before(req, route).is_err() { req.too_many_requests("Too many request. Please try again later.")?; } @@ -279,7 +279,7 @@ async fn process_request(custom_req: CustomRequest) -> HttpResponse { // Execute the request let mut request = HttpRequestHandler::new(custom_req.req, custom_req.body); - match process_simple_route(route, &mut request) { + match process_simple_route(route, &mut request).await { // Set default error response if required Err(e) => {