Skip to content

Commit

Permalink
admin: Use xxhash for etag (#6207)
Browse files Browse the repository at this point in the history
  • Loading branch information
jadidbourbaki authored Mar 30, 2024
1 parent e0bf179 commit 1217449
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"expvar"
"fmt"
"hash"
"hash/fnv"
"io"
"net"
"net/http"
Expand All @@ -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"
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 1217449

Please sign in to comment.