mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-27 17:52:56 +01:00
Support deserializing paths to sequences: use "/{tail}*" syntax
This commit is contained in:
parent
feee43094e
commit
116f7d13b0
@ -692,7 +692,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_extract_seq() {
|
fn test_extract_seq() {
|
||||||
let mut router = Router::<()>::build();
|
let mut router = Router::<()>::build();
|
||||||
router.path("/path/to/{tail:.*}", ());
|
router.path("/path/to/{tail}*", ());
|
||||||
let router = router.finish();
|
let router = router.finish();
|
||||||
|
|
||||||
let mut path = Path::new("/path/to/tail/with/slash%2fes");
|
let mut path = Path::new("/path/to/tail/with/slash%2fes");
|
||||||
|
@ -68,7 +68,7 @@ use crate::{
|
|||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
/// // extract `Tail` from a path using serde
|
/// // extract `Tail` from a path using serde
|
||||||
/// #[get("/path/to/{tail:.*}")]
|
/// #[get("/path/to/{tail}*")]
|
||||||
/// async fn index(info: web::Path<Tail>) -> String {
|
/// async fn index(info: web::Path<Tail>) -> String {
|
||||||
/// format!("Navigating to {}!", info.tail.join(" :: "))
|
/// format!("Navigating to {}!", info.tail.join(" :: "))
|
||||||
/// }
|
/// }
|
||||||
|
Loading…
Reference in New Issue
Block a user