summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorMatt Holt <mholt@users.noreply.github.com>2023-08-09 10:34:28 -0600
committerGitHub <noreply@github.com>2023-08-09 12:34:28 -0400
commit6cdcc2a78208b1d30b37fb06780160fcad48aab4 (patch)
treecf98d5aa691ac12570e1b6dae1d1116b0650255a /modules
parentfbb0ecfa322aa7710a3448453fd3ae40f037b8d1 (diff)
ci: Update to Go 1.21 (#5719)
* ci: Update to Go 1.21 * Bump quic-go to v0.37.4 * Check EnableFullDuplex err * Linter bug suppression See https://github.com/timakin/bodyclose/issues/52 --------- Co-authored-by: Francis Lavoie <lavofr@gmail.com>
Diffstat (limited to 'modules')
-rw-r--r--modules/caddyhttp/duplex_go120.go3
-rw-r--r--modules/caddyhttp/duplex_go121.go5
-rw-r--r--modules/caddyhttp/server.go5
3 files changed, 9 insertions, 4 deletions
diff --git a/modules/caddyhttp/duplex_go120.go b/modules/caddyhttp/duplex_go120.go
index 462f2c0..065ccf2 100644
--- a/modules/caddyhttp/duplex_go120.go
+++ b/modules/caddyhttp/duplex_go120.go
@@ -20,6 +20,7 @@ import (
"net/http"
)
-func enableFullDuplex(w http.ResponseWriter) {
+func enableFullDuplex(w http.ResponseWriter) error {
// Do nothing, Go 1.20 and earlier do not support full duplex
+ return nil
}
diff --git a/modules/caddyhttp/duplex_go121.go b/modules/caddyhttp/duplex_go121.go
index 4f3851c..a17d3af 100644
--- a/modules/caddyhttp/duplex_go121.go
+++ b/modules/caddyhttp/duplex_go121.go
@@ -20,6 +20,7 @@ import (
"net/http"
)
-func enableFullDuplex(w http.ResponseWriter) {
- http.NewResponseController(w).EnableFullDuplex()
+func enableFullDuplex(w http.ResponseWriter) error {
+ //nolint:bodyclose
+ return http.NewResponseController(w).EnableFullDuplex()
}
diff --git a/modules/caddyhttp/server.go b/modules/caddyhttp/server.go
index b31e6e5..daef777 100644
--- a/modules/caddyhttp/server.go
+++ b/modules/caddyhttp/server.go
@@ -291,7 +291,10 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if s.EnableFullDuplex {
// TODO: Remove duplex_go12*.go abstraction once our
// minimum Go version is 1.21 or later
- enableFullDuplex(w)
+ err := enableFullDuplex(w)
+ if err != nil {
+ s.accessLogger.Warn("failed to enable full duplex", zap.Error(err))
+ }
}
// encode the request for logging purposes before