@marcel91200 / caddy Mirror · read-only / commits / 2c48dda1
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 12, 17:00 UTC

caddyhttp: Only attempt to enable full duplex for HTTP/1.x (#6102)

Francis Lavoie committed Feb 13, 2024 at 13:45 UTC 2c48dda109d213be0012743d8afb2d1f017ff878
1 file changed +2 -2
modules/caddyhttp/server.go
+2 -2
@@ -301,11 +301,11 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
301
302 // enable full-duplex for HTTP/1, ensuring the entire
303 // request body gets consumed before writing the response
304 - if s.EnableFullDuplex {
304 + if s.EnableFullDuplex && r.ProtoMajor == 1 {
305 //nolint:bodyclose
306 err := http.NewResponseController(w).EnableFullDuplex()
307 if err != nil {
308 - s.accessLogger.Warn("failed to enable full duplex", zap.Error(err))
308 + s.logger.Warn("failed to enable full duplex", zap.Error(err))
309 }
310 }
311