Skip to content

Commit

Permalink
fix: Capture wildcard path correctly, resolve #167. (#171)
Browse files Browse the repository at this point in the history
c70d2bc resolved the panic raised in the issue, but it also exposed my
ignorance with regards to route-recognizer, our new routing library.

Placing the * after a named param, as it was in the original example,
leads to the behavior mentioned in #167. route-recognizer is operating
exactly as intended. `:path*` doesn't capture additional URL segments,
where `*path` does.
  • Loading branch information
Nicholas authored and yoshuawuyts committed Apr 15, 2019
1 parent c70d2bc commit dc36c89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/catch_all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ async fn echo_path(cx: Context<()>) -> String {

fn main() {
let mut app = tide::App::new(());
app.at("/echo_path/:path").get(echo_path);
app.at("/echo_path/*path").get(echo_path);
app.serve("127.0.0.1:8000").unwrap();
}

0 comments on commit dc36c89

Please sign in to comment.