Add HTTP/0.9 responses support
This commit is contained in:
		
				
					committed by
					
						 Sean McArthur
						Sean McArthur
					
				
			
			
				
	
			
			
			
						parent
						
							7388b676df
						
					
				
				
					commit
					56ad99bebb
				
			| @@ -103,6 +103,7 @@ struct Config { | ||||
|     #[cfg(feature = "__tls")] | ||||
|     tls: TlsBackend, | ||||
|     http_version_pref: HttpVersionPref, | ||||
|     http09_responses: bool, | ||||
|     http1_title_case_headers: bool, | ||||
|     http2_initial_stream_window_size: Option<u32>, | ||||
|     http2_initial_connection_window_size: Option<u32>, | ||||
| @@ -166,6 +167,7 @@ impl ClientBuilder { | ||||
|                 #[cfg(feature = "__tls")] | ||||
|                 tls: TlsBackend::default(), | ||||
|                 http_version_pref: HttpVersionPref::All, | ||||
|                 http09_responses: false, | ||||
|                 http1_title_case_headers: false, | ||||
|                 http2_initial_stream_window_size: None, | ||||
|                 http2_initial_connection_window_size: None, | ||||
| @@ -458,6 +460,10 @@ impl ClientBuilder { | ||||
|         builder.pool_max_idle_per_host(config.pool_max_idle_per_host); | ||||
|         connector.set_keepalive(config.tcp_keepalive); | ||||
|  | ||||
|         if config.http09_responses { | ||||
|             builder.http09_responses(true); | ||||
|         } | ||||
|  | ||||
|         if config.http1_title_case_headers { | ||||
|             builder.http1_title_case_headers(true); | ||||
|         } | ||||
| @@ -842,6 +848,12 @@ impl ClientBuilder { | ||||
|         self | ||||
|     } | ||||
|  | ||||
|     /// Allow HTTP/0.9 responses | ||||
|     pub fn http09_responses(mut self) -> ClientBuilder { | ||||
|         self.config.http09_responses = true; | ||||
|         self | ||||
|     } | ||||
|  | ||||
|     /// Only use HTTP/2. | ||||
|     pub fn http2_prior_knowledge(mut self) -> ClientBuilder { | ||||
|         self.config.http_version_pref = HttpVersionPref::Http2; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user