File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ impl PathAndQuery {
50
50
0x40 ..=0x5F |
51
51
0x61 ..=0x7A |
52
52
0x7C |
53
- 0x7E => { }
53
+ 0x7E ..= 0xFF => { }
54
54
55
55
// These are code points that are supposed to be
56
56
// percent-encoded in the path but there are clients
@@ -82,7 +82,7 @@ impl PathAndQuery {
82
82
0x21 |
83
83
0x24 ..=0x3B |
84
84
0x3D |
85
- 0x3F ..=0x7E => { }
85
+ 0x3F ..=0xFF => { }
86
86
87
87
b'#' => {
88
88
fragment = Some ( i) ;
@@ -556,6 +556,16 @@ mod tests {
556
556
assert_eq ! ( "qr=%3" , pq( "/a/b?qr=%3" ) . query( ) . unwrap( ) ) ;
557
557
}
558
558
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
+
559
569
#[ test]
560
570
fn json_is_fine ( ) {
561
571
assert_eq ! (
You can’t perform that action at this time.
0 commit comments