File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,5 +6,5 @@ repository = "https://github.com/rustasync/route-recognizer"
66keywords = [" router" , " url" ]
77edition = " 2018"
88
9- version = " 0.2 .0"
9+ version = " 0.3 .0"
1010authors = [" wycats" , " rustasync" ]
Original file line number Diff line number Diff line change @@ -554,4 +554,21 @@ mod tests {
554554 let m = router. recognize ( "/4.static.static" ) ;
555555 assert ! ( m. is_err( ) ) ;
556556 }
557+
558+ #[ test]
559+ fn test_string_encoding ( ) {
560+ let mut router = Router :: new ( ) ;
561+ router. add ( "/foo%2Fbar" , "Hello" . to_string ( ) ) ;
562+ router. add ( "/foo bar" , "Hello" . to_string ( ) ) ;
563+
564+ // assert_eq!(
565+ // router.recognize("/foo%2fbar").unwrap().handler().as_str(),
566+ // "Hello"
567+ // );
568+
569+ assert_eq ! (
570+ router. recognize( "/foo%20bar" ) . unwrap( ) . handler( ) . as_str( ) ,
571+ "Hello"
572+ ) ;
573+ }
557574}
You can’t perform that action at this time.
0 commit comments