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"] }
27
27
futures-util = { version = " 0.3.1" , default-features = false }
28
28
29
29
[features ]
30
- default = [" native-tokio" ]
30
+ default = [" native-tokio" , " http1" ]
31
+ http1 = [" hyper/http1" ]
32
+ http2 = [" hyper/http2" ]
31
33
webpki-tokio = [" tokio-runtime" , " webpki-roots" ]
32
34
native-tokio = [" tokio-runtime" , " rustls-native-certs" ]
33
35
tokio-runtime = [" hyper/runtime" , " ct-logs" ]
Original file line number Diff line number Diff line change @@ -61,7 +61,17 @@ impl HttpsConnector<HttpConnector> {
61
61
let mut http = HttpConnector :: new ( ) ;
62
62
http. enforce_http ( false ) ;
63
63
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
+
65
75
config. ct_logs = Some ( & ct_logs:: LOGS ) ;
66
76
( http, config) . into ( )
67
77
}
You can’t perform that action at this time.
0 commit comments