@@ -21,9 +21,11 @@ use super::task::{hyper_executor, hyper_task, hyper_task_return_type, AsTaskType
21
21
/// - hyper_clientconn_options_set_preserve_header_case: Set whether header case is preserved.
22
22
/// - hyper_clientconn_options_set_preserve_header_order: Set whether header order is preserved.
23
23
/// - hyper_clientconn_options_http1_allow_multiline_headers: Set whether HTTP/1 connections accept obsolete line folding for header values.
24
+ /// - hyper_client_conn_options_http1_allow_spaces_before_first_header: Set whether HTTP/1 connections accept leading whitespaces before first header.
24
25
/// - hyper_clientconn_options_free: Free a set of HTTP clientconn options.
25
26
pub struct hyper_clientconn_options {
26
27
http1_allow_obsolete_multiline_headers_in_responses : bool ,
28
+ http1_allow_spaces_before_first_header_name : bool ,
27
29
http1_preserve_header_case : bool ,
28
30
http1_preserve_header_order : bool ,
29
31
http2 : bool ,
@@ -116,6 +118,7 @@ ffi_fn! {
116
118
117
119
conn:: http1:: Builder :: new( )
118
120
. allow_obsolete_multiline_headers_in_responses( options. http1_allow_obsolete_multiline_headers_in_responses)
121
+ . allow_spaces_before_first_header_name( options. http1_allow_spaces_before_first_header_name)
119
122
. preserve_header_case( options. http1_preserve_header_case)
120
123
. preserve_header_order( options. http1_preserve_header_order)
121
124
. handshake:: <_, crate :: body:: Incoming >( io)
@@ -272,4 +275,17 @@ ffi_fn! {
272
275
opts. http1_allow_obsolete_multiline_headers_in_responses = enabled != 0 ;
273
276
hyper_code:: HYPERE_OK
274
277
}
278
+
279
+ }
280
+
281
+ ffi_fn ! {
282
+ /// Set whether HTTP/1 connections accept leading whitespaces before first header.
283
+ ///
284
+ /// Pass `0` to disable, `1` to enable.
285
+ ///
286
+ fn hyper_clientconn_options_http1_allow_spaces_before_first_header_name( opts: * mut hyper_clientconn_options, enabled: c_int) -> hyper_code {
287
+ let opts = non_null! { & mut * opts ?= hyper_code:: HYPERE_INVALID_ARG } ;
288
+ opts. http1_allow_spaces_before_first_header_name = enabled != 0 ;
289
+ hyper_code:: HYPERE_OK
290
+ }
275
291
}
0 commit comments