We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eeb3268 commit 21740efCopy full SHA for 21740ef
tonic/src/transport/service/tls.rs
@@ -82,10 +82,8 @@ impl TlsConnector {
82
// explicitly set `assume_http2` to true, we'll allow it to be missing.
83
let (_, session) = io.get_ref();
84
let alpn_protocol = session.alpn_protocol();
85
- if alpn_protocol != Some(ALPN_H2) {
86
- if alpn_protocol.is_some() || !self.assume_http2 {
87
- return Err(TlsError::H2NotNegotiated.into());
88
- }
+ if !(alpn_protocol == Some(ALPN_H2) || self.assume_http2) {
+ return Err(TlsError::H2NotNegotiated.into());
89
}
90
Ok(BoxedIo::new(io))
91
0 commit comments