aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFrancis Lavoie <[email protected]>2024-02-13 13:45:38 -0500
committerGitHub <[email protected]>2024-02-13 13:45:38 -0500
commit2c48dda109d213be0012743d8afb2d1f017ff878 (patch)
treeba2505a759ff4e7597e79398bc1ec30dae8c03cf
parent30d63648f526c1f994173ce24ccf7fe71ca24365 (diff)
downloadcaddy-2c48dda109d213be0012743d8afb2d1f017ff878.tar.gz
caddy-2c48dda109d213be0012743d8afb2d1f017ff878.zip
caddyhttp: Only attempt to enable full duplex for HTTP/1.x (#6102)
-rw-r--r--modules/caddyhttp/server.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/caddyhttp/server.go b/modules/caddyhttp/server.go
index 1dec60795..77af31360 100644
--- a/modules/caddyhttp/server.go
+++ b/modules/caddyhttp/server.go
@@ -301,11 +301,11 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// enable full-duplex for HTTP/1, ensuring the entire
// request body gets consumed before writing the response
- if s.EnableFullDuplex {
+ if s.EnableFullDuplex && r.ProtoMajor == 1 {
//nolint:bodyclose
err := http.NewResponseController(w).EnableFullDuplex()
if err != nil {
- s.accessLogger.Warn("failed to enable full duplex", zap.Error(err))
+ s.logger.Warn("failed to enable full duplex", zap.Error(err))
}
}