File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,9 @@ hyper = { version = "0.14", features = ["full"] }
2727futures-util = { version = " 0.3.1" , default-features = false }
2828
2929[features ]
30- default = [" native-tokio" ]
30+ default = [" native-tokio" , " http1" ]
31+ http1 = [" hyper/http1" ]
32+ http2 = [" hyper/http2" ]
3133webpki-tokio = [" tokio-runtime" , " webpki-roots" ]
3234native-tokio = [" tokio-runtime" , " rustls-native-certs" ]
3335tokio-runtime = [" hyper/runtime" , " ct-logs" ]
Original file line number Diff line number Diff line change @@ -61,7 +61,17 @@ impl HttpsConnector<HttpConnector> {
6161 let mut http = HttpConnector :: new ( ) ;
6262 http. enforce_http ( false ) ;
6363
64- config. alpn_protocols = vec ! [ b"h2" . to_vec( ) , b"http/1.1" . to_vec( ) ] ;
64+ config. alpn_protocols . clear ( ) ;
65+ #[ cfg( feature = "http2" ) ]
66+ {
67+ config. alpn_protocols . push ( b"h2" . to_vec ( ) ) ;
68+ }
69+
70+ #[ cfg( feature = "http1" ) ]
71+ {
72+ config. alpn_protocols . push ( b"http/1.1" . to_vec ( ) ) ;
73+ }
74+
6575 config. ct_logs = Some ( & ct_logs:: LOGS ) ;
6676 ( http, config) . into ( )
6777 }
You can’t perform that action at this time.
0 commit comments