-
-
Notifications
You must be signed in to change notification settings - Fork 331
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Expected Behavior
A request to "/" should be handled by the "/" handler, not the "/*path" handler
Actual Behavior
The request is handled by the "/*path" handler
Steps to Reproduce the Problem
use poem::{Route, Server, IntoResponse, test::TestClient, get, handler};
#[handler]
async fn handler_a() -> impl IntoResponse {
"A"
}
#[handler]
async fn handler_b() -> impl IntoResponse {
"B"
}
#[tokio::main]
async fn main() {
let routes = Route::new()
.at("/", handler_a)
.at("/*path", handler_b);
let resp = TestClient::new(routes).get("/").send().await;
// prints out:
// [src/main.rs:23:5] resp.0.into_body().into_string().await.unwrap() = "B"
dbg!(resp.0.into_body().into_string().await.unwrap());
}
Specifications
- Version: 3.1.12
- Platform: Linux
- Subsystem: Router
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working