@@ -192,8 +192,7 @@ pub struct Builder {
192
192
h1_preserve_header_order : bool ,
193
193
h1_read_buf_exact_size : Option < usize > ,
194
194
h1_max_buf_size : Option < usize > ,
195
- #[ cfg( feature = "ffi" ) ]
196
- h1_headers_raw : bool ,
195
+ h1_raw_message : bool ,
197
196
#[ cfg( feature = "http2" ) ]
198
197
h2_builder : proto:: h2:: client:: Config ,
199
198
version : Proto ,
@@ -603,8 +602,7 @@ impl Builder {
603
602
#[ cfg( feature = "ffi" ) ]
604
603
h1_preserve_header_order : false ,
605
604
h1_max_buf_size : None ,
606
- #[ cfg( feature = "ffi" ) ]
607
- h1_headers_raw : false ,
605
+ h1_raw_message : false ,
608
606
#[ cfg( feature = "http2" ) ]
609
607
h2_builder : Default :: default ( ) ,
610
608
#[ cfg( feature = "http1" ) ]
@@ -811,9 +809,16 @@ impl Builder {
811
809
self
812
810
}
813
811
814
- #[ cfg( feature = "ffi" ) ]
815
- pub ( crate ) fn http1_headers_raw ( & mut self , enabled : bool ) -> & mut Self {
816
- self . h1_headers_raw = enabled;
812
+ /// Set whether to include the raw bytes of HTTP/1 responses.
813
+ ///
814
+ /// This will store a [`Http1RawMessage`](crate::ext::Http1RawMessage)
815
+ /// in extensions of HTTP/1 responses.
816
+ ///
817
+ /// Note that this setting does not affect HTTP/2.
818
+ ///
819
+ /// Default is false.
820
+ pub fn http1_raw_message ( & mut self , enabled : bool ) -> & mut Self {
821
+ self . h1_raw_message = enabled;
817
822
self
818
823
}
819
824
@@ -1033,8 +1038,9 @@ impl Builder {
1033
1038
conn. set_h09_responses ( ) ;
1034
1039
}
1035
1040
1036
- #[ cfg( feature = "ffi" ) ]
1037
- conn. set_raw_headers ( opts. h1_headers_raw ) ;
1041
+ if opts. h1_raw_message {
1042
+ conn. set_h1_raw_message ( ) ;
1043
+ }
1038
1044
1039
1045
if let Some ( sz) = opts. h1_read_buf_exact_size {
1040
1046
conn. set_read_buf_exact_size ( sz) ;
0 commit comments