File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -943,6 +943,8 @@ fn title_case(dst: &mut Vec<u8>, name: &[u8]) {
943
943
if let Some ( c) = iter. next ( ) {
944
944
if * c >= b'a' && * c <= b'z' {
945
945
dst. push ( * c ^ b' ' ) ;
946
+ } else {
947
+ dst. push ( * c) ;
946
948
}
947
949
}
948
950
@@ -953,6 +955,8 @@ fn title_case(dst: &mut Vec<u8>, name: &[u8]) {
953
955
if let Some ( c) = iter. next ( ) {
954
956
if * c >= b'a' && * c <= b'z' {
955
957
dst. push ( * c ^ b' ' ) ;
958
+ } else {
959
+ dst. push ( * c) ;
956
960
}
957
961
}
958
962
}
@@ -1371,6 +1375,7 @@ mod tests {
1371
1375
let mut head = MessageHead :: default ( ) ;
1372
1376
head. headers . insert ( "content-length" , HeaderValue :: from_static ( "10" ) ) ;
1373
1377
head. headers . insert ( "content-type" , HeaderValue :: from_static ( "application/json" ) ) ;
1378
+ head. headers . insert ( "*-*" , HeaderValue :: from_static ( "o_o" ) ) ;
1374
1379
1375
1380
let mut vec = Vec :: new ( ) ;
1376
1381
Client :: encode ( Encode {
@@ -1381,7 +1386,7 @@ mod tests {
1381
1386
title_case_headers : true ,
1382
1387
} , & mut vec) . unwrap ( ) ;
1383
1388
1384
- assert_eq ! ( vec, b"GET / HTTP/1.1\r \n Content-Length: 10\r \n Content-Type: application/json\r \n \r \n " . to_vec( ) ) ;
1389
+ assert_eq ! ( vec, b"GET / HTTP/1.1\r \n Content-Length: 10\r \n Content-Type: application/json\r \n *-*: o_o \r \n \r \n " . to_vec( ) ) ;
1385
1390
}
1386
1391
1387
1392
#[ test]
You can’t perform that action at this time.
0 commit comments