From 1217449609050471dfb70fdf35c9a22d738e2bef Mon Sep 17 00:00:00 2001 From: Hayder <96513935+jadidbourbaki@users.noreply.github.com> Date: Sat, 30 Mar 2024 09:24:50 -0400 Subject: [PATCH] admin: Use xxhash for etag (#6207) --- admin.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin.go b/admin.go index 0a9bfc49..c6151d11 100644 --- a/admin.go +++ b/admin.go @@ -26,7 +26,6 @@ import ( "expvar" "fmt" "hash" - "hash/fnv" "io" "net" "net/http" @@ -41,6 +40,7 @@ import ( "time" "github.com/caddyserver/certmagic" + "github.com/cespare/xxhash/v2" "github.com/prometheus/client_golang/prometheus" "go.uber.org/zap" "go.uber.org/zap/zapcore" @@ -946,7 +946,7 @@ func (h adminHandler) originAllowed(origin *url.URL) bool { // etagHasher returns a the hasher we used on the config to both // produce and verify ETags. -func etagHasher() hash.Hash32 { return fnv.New32a() } +func etagHasher() hash.Hash { return xxhash.New() } // makeEtag returns an Etag header value (including quotes) for // the given config path and hash of contents at that path.