mirror of
https://mzte.de/git/LordMZTE/brevo
synced 2024-12-12 16:53:11 +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,
|
body::BodyDeserializeError,
|
||||||
http::{uri::InvalidUri, Uri},
|
http::{uri::InvalidUri, Uri},
|
||||||
redirect,
|
redirect,
|
||||||
reject::{self, Reject},
|
reject::{self, MethodNotAllowed, Reject},
|
||||||
reply,
|
reply,
|
||||||
Rejection,
|
Rejection,
|
||||||
Reply,
|
Reply,
|
||||||
|
@ -120,7 +120,7 @@ pub async fn try_handle_reject(
|
||||||
brevo: Arc<Brevo>,
|
brevo: Arc<Brevo>,
|
||||||
err: Rejection,
|
err: Rejection,
|
||||||
) -> Result<Box<dyn Reply>, Rejection> {
|
) -> Result<Box<dyn Reply>, Rejection> {
|
||||||
if err.is_not_found() {
|
if err.is_not_found() || err.find::<MethodNotAllowed>().is_some() {
|
||||||
let rendered = brevo
|
let rendered = brevo
|
||||||
.tera
|
.tera
|
||||||
.render("404.html", &Context::new())
|
.render("404.html", &Context::new())
|
||||||
|
|
Loading…
Reference in a new issue