Skip to content

Commit

Permalink
reverseproxy: Support http1.1>h2c (close #4777) (#4778)
Browse files Browse the repository at this point in the history
  • Loading branch information
mholt committed May 10, 2022
1 parent 693e9b5 commit 57d27c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/caddyhttp/reverseproxy/httptransport.go
Expand Up @@ -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)
}

Expand Down

0 comments on commit 57d27c1

Please sign in to comment.