Add http1_title_case_headers option to ClientBuilder (#463)
This commit is contained in:
		
				
					committed by
					
						 Sean McArthur
						Sean McArthur
					
				
			
			
				
	
			
			
			
						parent
						
							4fba983e5e
						
					
				
				
					commit
					aa8348ba1e
				
			| @@ -78,6 +78,7 @@ struct Config { | ||||
|     #[cfg(feature = "tls")] | ||||
|     tls: TlsBackend, | ||||
|     http2_only: bool, | ||||
|     http1_title_case_headers: bool, | ||||
|     local_address: Option<IpAddr>, | ||||
| } | ||||
|  | ||||
| @@ -110,6 +111,7 @@ impl ClientBuilder { | ||||
|                 #[cfg(feature = "tls")] | ||||
|                 tls: TlsBackend::default(), | ||||
|                 http2_only: false, | ||||
|                 http1_title_case_headers: false, | ||||
|                 local_address: None, | ||||
|             }, | ||||
|         } | ||||
| @@ -186,6 +188,10 @@ impl ClientBuilder { | ||||
|             builder.http2_only(true); | ||||
|         } | ||||
|  | ||||
|         if config.http1_title_case_headers { | ||||
|             builder.http1_title_case_headers(true); | ||||
|         } | ||||
|  | ||||
|         let hyper_client = builder.build(connector); | ||||
|  | ||||
|         let proxies_maybe_http_auth = proxies | ||||
| @@ -329,6 +335,12 @@ impl ClientBuilder { | ||||
|         self | ||||
|     } | ||||
|  | ||||
|     /// Enable case sensitive headers. | ||||
|     pub fn http1_title_case_headers(mut self) -> ClientBuilder { | ||||
|         self.config.http1_title_case_headers = true; | ||||
|         self | ||||
|     } | ||||
|  | ||||
|     /// Set a timeout for only the connect phase of a `Client`. | ||||
|     /// | ||||
|     /// Default is `None`. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user