Improve debug_handler on tuple response types (#2201)

Co-authored-by: David Pedersen <[email protected]>
Co-authored-by: Jonas Platte <[email protected]>
This commit is contained in:
Sleep_AllDay
2023-12-30 21:48:35 +00:00
committed by GitHub
co-authored by David Pedersen Jonas Platte
parent 85573e0573
commit d2cea5cdbd
13 changed files with 357 additions and 17 deletions
+3 -1
View File
@@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
# Unreleased
- None.
- **fixed:** Improve `debug_handler` on tuple response types ([#2201])
[#2201]: https://github.com/tokio-rs/axum/pull/2201
# 0.7.3 (29. December, 2023)
+12
View File
@@ -31,6 +31,18 @@ async fn nest() {
assert_eq!(res.text().await, "fallback");
}
#[crate::test]
async fn two() {
let app = Router::new()
.route("/first", get(|| async {}))
.route("/second", get(|| async {}))
.fallback(get(|| async { "fallback" }));
let client = TestClient::new(app);
let res = client.get("/does-not-exist").await;
assert_eq!(res.status(), StatusCode::OK);
assert_eq!(res.text().await, "fallback");
}
#[crate::test]
async fn or() {
let one = Router::new().route("/one", get(|| async {}));