summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatt Holt <[email protected]>2022-05-10 15:25:58 -0600
committerGitHub <[email protected]>2022-05-10 17:25:58 -0400
commit57d27c1b58e3e47d813a48a60557f013dc3b87d1 (patch)
tree32d4f7cae49bcc3b3ae1fc362b0ce3b319ffb3f1
parent693e9b5283e675b56084ecc83d73176cab0ee27c (diff)
downloadcaddy-57d27c1b58e3e47d813a48a60557f013dc3b87d1.tar.gz
caddy-57d27c1b58e3e47d813a48a60557f013dc3b87d1.zip
reverseproxy: Support http1.1>h2c (close #4777) (#4778)
-rw-r--r--modules/caddyhttp/reverseproxy/httptransport.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/caddyhttp/reverseproxy/httptransport.go b/modules/caddyhttp/reverseproxy/httptransport.go
index f7472bea2..264bd2aa8 100644
--- a/modules/caddyhttp/reverseproxy/httptransport.go
+++ b/modules/caddyhttp/reverseproxy/httptransport.go
@@ -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)
}