File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ impl PathAndQuery {
5050 0x40 ..=0x5F |
5151 0x61 ..=0x7A |
5252 0x7C |
53- 0x7E => { }
53+ 0x7E ..= 0xFF => { }
5454
5555 // These are code points that are supposed to be
5656 // percent-encoded in the path but there are clients
@@ -82,7 +82,7 @@ impl PathAndQuery {
8282 0x21 |
8383 0x24 ..=0x3B |
8484 0x3D |
85- 0x3F ..=0x7E => { }
85+ 0x3F ..=0xFF => { }
8686
8787 b'#' => {
8888 fragment = Some ( i) ;
@@ -556,6 +556,16 @@ mod tests {
556556 assert_eq ! ( "qr=%3" , pq( "/a/b?qr=%3" ) . query( ) . unwrap( ) ) ;
557557 }
558558
559+ #[ test]
560+ fn allow_utf8_in_path ( ) {
561+ assert_eq ! ( "/🍕" , pq( "/🍕" ) . path( ) ) ;
562+ }
563+
564+ #[ test]
565+ fn allow_utf8_in_query ( ) {
566+ assert_eq ! ( Some ( "pizza=🍕" ) , pq( "/test?pizza=🍕" ) . query( ) ) ;
567+ }
568+
559569 #[ test]
560570 fn json_is_fine ( ) {
561571 assert_eq ! (
You can’t perform that action at this time.
0 commit comments