reverseproxy: Support http1.1>h2c (close #4777) (#4778)

This commit is contained in:
Matt Holt 2022-05-10 15:25:58 -06:00 committed by GitHub
parent 693e9b5283
commit 57d27c1b58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -247,8 +247,8 @@ func (h *HTTPTransport) RoundTrip(req *http.Request) (*http.Response, error) {
h.SetScheme(req)
// if H2C ("HTTP/2 over cleartext") is enabled and the upstream request is
// HTTP/2 without TLS, use the alternate H2C-capable transport instead
if req.ProtoMajor == 2 && req.URL.Scheme == "http" && h.h2cTransport != nil {
// HTTP without TLS, use the alternate H2C-capable transport instead
if req.URL.Scheme == "http" && h.h2cTransport != nil {
return h.h2cTransport.RoundTrip(req)
}