File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -589,6 +589,12 @@ impl<'a> HeaderView<'a> {
589
589
pub fn value_string ( & self ) -> String {
590
590
ValueString ( self . 1 ) . to_string ( )
591
591
}
592
+
593
+ /// Access the raw value of the header.
594
+ #[ inline]
595
+ pub fn raw ( & self ) -> & Raw {
596
+ self . 1 . raw ( )
597
+ }
592
598
}
593
599
594
600
impl < ' a > fmt:: Display for HeaderView < ' a > {
@@ -913,6 +919,17 @@ mod tests {
913
919
}
914
920
}
915
921
922
+ #[ test]
923
+ fn test_header_view_raw ( ) {
924
+ let mut headers = Headers :: new ( ) ;
925
+ headers. set_raw ( "foo" , vec ! [ b"one" . to_vec( ) , b"two" . to_vec( ) ] ) ;
926
+ for header in headers. iter ( ) {
927
+ assert_eq ! ( header. name( ) , "foo" ) ;
928
+ let values: Vec < & [ u8 ] > = header. raw ( ) . iter ( ) . collect ( ) ;
929
+ assert_eq ! ( values, vec![ b"one" , b"two" ] ) ;
930
+ }
931
+ }
932
+
916
933
#[ test]
917
934
fn test_eq ( ) {
918
935
let mut headers1 = Headers :: new ( ) ;
You can’t perform that action at this time.
0 commit comments