From f45a6de20dd19e82e58c85b37e03957b2203b544 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Fri, 21 Jul 2023 21:00:48 -0700 Subject: go.mod: Update quic-go to v0.37.0, bump to Go 1.20 minimum (#5644) * update quic-go to v0.37.0 * Bump to Go 1.20 * Bump golangci-lint version, yml syntax consistency * Use skip-pkg-cache workaround * Workaround needed for both? * Seeding weakrand is no longer necessary --------- Co-authored-by: Matt Holt Co-authored-by: Francis Lavoie --- modules/caddyhttp/errors.go | 5 ----- 1 file changed, 5 deletions(-) (limited to 'modules/caddyhttp/errors.go') diff --git a/modules/caddyhttp/errors.go b/modules/caddyhttp/errors.go index 9d1cf47..1538d43 100644 --- a/modules/caddyhttp/errors.go +++ b/modules/caddyhttp/errors.go @@ -20,15 +20,10 @@ import ( "path" "runtime" "strings" - "time" "github.com/caddyserver/caddy/v2" ) -func init() { - weakrand.Seed(time.Now().UnixNano()) -} - // Error is a convenient way for a Handler to populate the // essential fields of a HandlerError. If err is itself a // HandlerError, then any essential fields that are not -- cgit v1.2.3 From 18c309b5fa1847a5303a053a4c79d3a395bdd823 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Tue, 25 Jul 2023 09:41:56 -0600 Subject: caddyhttp: Preserve original error (fix #5652) --- modules/caddyhttp/errors.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules/caddyhttp/errors.go') diff --git a/modules/caddyhttp/errors.go b/modules/caddyhttp/errors.go index 1538d43..fc8ffbf 100644 --- a/modules/caddyhttp/errors.go +++ b/modules/caddyhttp/errors.go @@ -15,6 +15,7 @@ package caddyhttp import ( + "errors" "fmt" weakrand "math/rand" "path" @@ -30,7 +31,8 @@ import ( // set will be populated. func Error(statusCode int, err error) HandlerError { const idLen = 9 - if he, ok := err.(HandlerError); ok { + var he HandlerError + if errors.As(err, &he) { if he.ID == "" { he.ID = randString(idLen, true) } -- cgit v1.2.3