Return 404 if not route matched

This commit is contained in:
2022-07-12 14:17:38 +00:00
committed by GitHub
parent 713ab3f5c8
commit ddde23924f

View File

@@ -48,9 +48,12 @@ impl Service<Request<Body>> for PixivDownloaderSvc {
}
}
}),
None => {
Box::pin(async { Ok(Response::builder().body(Body::from("hello world")).unwrap()) })
}
None => Box::pin(async {
Ok(Response::builder()
.status(404)
.body(Body::from("404 Not Found"))
.unwrap())
}),
}
}
}