File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -2500,7 +2500,7 @@ mod tests {
2500
2500
#[ test]
2501
2501
fn test_to_headers_encoding ( ) {
2502
2502
use crate :: Status ;
2503
- let special_char_message = "Beyond ascii \t \n \r 🌶️💉💧🐮🍺" ;
2503
+ let special_char_message = "Beyond 100% ascii \t \n \r 🌶️💉💧🐮🍺" ;
2504
2504
let s1 = Status :: unknown ( special_char_message) ;
2505
2505
2506
2506
assert_eq ! ( s1. message( ) , special_char_message) ;
@@ -2509,6 +2509,17 @@ mod tests {
2509
2509
let s2 = Status :: from_header_map ( & s1_map) . unwrap ( ) ;
2510
2510
2511
2511
assert_eq ! ( s1. message( ) , s2. message( ) ) ;
2512
+
2513
+ assert ! (
2514
+ s1_map
2515
+ . get( "grpc-message" )
2516
+ . unwrap( )
2517
+ . to_str( )
2518
+ . unwrap( )
2519
+ . starts_with( "Beyond%20100%25%20ascii" ) ,
2520
+ "Percent sign or other character isn't encoded as desired: {:?}" ,
2521
+ s1_map. get( "grpc-message" )
2522
+ ) ;
2512
2523
}
2513
2524
2514
2525
#[ test]
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ const ENCODING_SET: &AsciiSet = &CONTROLS
14
14
. add ( b' ' )
15
15
. add ( b'"' )
16
16
. add ( b'#' )
17
+ . add ( b'%' )
17
18
. add ( b'<' )
18
19
. add ( b'>' )
19
20
. add ( b'`' )
You can’t perform that action at this time.
0 commit comments