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