mirror of
https://mzte.de/git/LordMZTE/brevo
synced 2024-10-31 20:59:01 +01:00
also show 404 page for MethodNotAllowed
This commit is contained in:
parent
e8ecdfef34
commit
6b59413135
1 changed files with 2 additions and 2 deletions
|
@ -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<Brevo>,
|
||||
err: Rejection,
|
||||
) -> Result<Box<dyn Reply>, Rejection> {
|
||||
if err.is_not_found() {
|
||||
if err.is_not_found() || err.find::<MethodNotAllowed>().is_some() {
|
||||
let rendered = brevo
|
||||
.tera
|
||||
.render("404.html", &Context::new())
|
||||
|
|
Loading…
Reference in a new issue