feat(http1): Make HTTP/1 support an optional feature
cc #2251 BREAKING CHANGE: This puts all HTTP/1 methods and support behind an `http1` cargo feature, which will not be enabled by default. To use HTTP/1, add `features = ["http1"]` to the hyper dependency in your `Cargo.toml`.
This commit is contained in:
		
							
								
								
									
										18
									
								
								src/lib.rs
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								src/lib.rs
									
									
									
									
									
								
							| @@ -42,6 +42,7 @@ | ||||
|  | ||||
| #[doc(hidden)] | ||||
| pub use http; | ||||
| #[cfg(any(feature = "http1", feature = "http2"))] | ||||
| #[macro_use] | ||||
| extern crate tracing; | ||||
|  | ||||
| @@ -51,23 +52,28 @@ extern crate test; | ||||
| pub use http::{header, HeaderMap, Method, Request, Response, StatusCode, Uri, Version}; | ||||
|  | ||||
| pub use crate::body::Body; | ||||
| pub use crate::client::Client; | ||||
| pub use crate::error::{Error, Result}; | ||||
| pub use crate::server::Server; | ||||
|  | ||||
| #[macro_use] | ||||
| mod cfg; | ||||
| #[macro_use] | ||||
| mod common; | ||||
| pub mod body; | ||||
| pub mod client; | ||||
| #[doc(hidden)] // Mistakenly public... | ||||
| pub mod error; | ||||
| mod headers; | ||||
| #[cfg(test)] | ||||
| mod mock; | ||||
| mod proto; | ||||
| #[cfg(any(feature = "http1", feature = "http2",))] | ||||
| pub mod rt; | ||||
| pub mod server; | ||||
| pub mod service; | ||||
| pub mod upgrade; | ||||
|  | ||||
| cfg_any_http! { | ||||
|     mod headers; | ||||
|     mod proto; | ||||
|     pub mod client; | ||||
|     pub mod server; | ||||
|  | ||||
|     pub use crate::client::Client; | ||||
|     pub use crate::server::Server; | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user