Closed markcda closed 1 week ago
Change this line to:
let rest_path = req.param::<String>("rest_path").ok_or("Cannot get rest path.").unwrap();
In old version salvo use **rest_path
to get the rest path, but **rest_path
is not a valid variable name and would cause problems when parsing OpenAPI, so we made a change.
Ok, thanks! Then docs in the site are needed to change too (https://salvo.rs/book/concepts/router.html#path-filter)
Thanks for your reminder, the document has been fixed.
Describe the bug Can't get
**rest_path
To Reproduce Steps to reproduce the behavior:
example-path
inexamples
folder.Cargo.toml
:[dependencies] salvo = { workspace = true } tokio = { workspace = true, features = ["macros"] } tracing.workspace = true tracing-subscriber.workspace = true
cargo run --bin example-path
curl localhost:5800/assets/wherever
Expected behavior No error.
Desktop (please complete the following information):