diff --git a/src/handlers.rs b/src/handlers.rs index 65f9817..d84b914 100644 --- a/src/handlers.rs +++ b/src/handlers.rs @@ -8,7 +8,7 @@ use warp::{ body::BodyDeserializeError, http::{uri::InvalidUri, Uri}, redirect, - reject::{self, Reject}, + reject::{self, MethodNotAllowed, Reject}, reply, Rejection, Reply, @@ -120,7 +120,7 @@ pub async fn try_handle_reject( brevo: Arc, err: Rejection, ) -> Result, Rejection> { - if err.is_not_found() { + if err.is_not_found() || err.find::().is_some() { let rendered = brevo .tera .render("404.html", &Context::new())