@marcel91200 / caddy Mirror · read-only / commits / 57d27c1b
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 13, 18:00 UTC

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

Matt Holt committed May 10, 2022 at 15:25 UTC 57d27c1b58e3e47d813a48a60557f013dc3b87d1
1 file changed +2 -2
modules/caddyhttp/reverseproxy/httptransport.go
+2 -2
@@ -247,8 +247,8 @@ func (h *HTTPTransport) RoundTrip(req *http.Request) (*http.Response, error) {
247 h.SetScheme(req)
248
249 // if H2C ("HTTP/2 over cleartext") is enabled and the upstream request is
250 - // HTTP/2 without TLS, use the alternate H2C-capable transport instead
251 - if req.ProtoMajor == 2 && req.URL.Scheme == "http" && h.h2cTransport != nil {
250 + // HTTP without TLS, use the alternate H2C-capable transport instead
251 + if req.URL.Scheme == "http" && h.h2cTransport != nil {
252 return h.h2cTransport.RoundTrip(req)
253 }
254