I discovered an issue with the route matching behavior in the example code located in the examples/actix_example directory. When accessing routes that do not match the specified patterns like /xxx, instead of returning a 404 Not Found page, the application returns an error message can not parse 'xxx' to a i32.
Steps to Reproduce
Navigate to the examples/actix_example directory.
Run cargo run to start the application.
Access a route that does not match any specified patterns, for example, /xxx.
Observe the application's response and note that it does not behave as expected.
Expected Behavior
I expect the application to handle routes that do not match any specified patterns appropriately, such as returning a 404 page.
Actual Behavior
Instead of returning a 404 page, the application returns an error message can not parse 'xxx' to a i32.
Reproduces How Often
This issue is reproducible every time.
Workarounds
The issue seems to be caused by /xxx matching the #[get("/{id}")] route in examples/actix_example/api/src/lib.rs. This leads to the execution of the async fn edit(data: web::Data<AppState>, id: web::Path<i32>) -> Result<HttpResponse, Error> handler function.
Description
I discovered an issue with the route matching behavior in the example code located in the
examples/actix_example
directory. When accessing routes that do not match the specified patterns like/xxx
, instead of returning a 404 Not Found page, the application returns an error messagecan not parse 'xxx' to a i32
.Steps to Reproduce
examples/actix_example
directory.cargo run
to start the application./xxx
.Expected Behavior
I expect the application to handle routes that do not match any specified patterns appropriately, such as returning a 404 page.
Actual Behavior
Instead of returning a 404 page, the application returns an error message
can not parse 'xxx' to a i32
.Reproduces How Often
This issue is reproducible every time.
Workarounds
The issue seems to be caused by
/xxx
matching the#[get("/{id}")]
route inexamples/actix_example/api/src/lib.rs
. This leads to the execution of theasync fn edit(data: web::Data<AppState>, id: web::Path<i32>) -> Result<HttpResponse, Error>
handler function.