Skip to content

Commit 1217449

Browse files
admin: Use xxhash for etag (#6207)
1 parent e0bf179 commit 1217449

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

admin.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import (
2626
"expvar"
2727
"fmt"
2828
"hash"
29-
"hash/fnv"
3029
"io"
3130
"net"
3231
"net/http"
@@ -41,6 +40,7 @@ import (
4140
"time"
4241

4342
"github.com/caddyserver/certmagic"
43+
"github.com/cespare/xxhash/v2"
4444
"github.com/prometheus/client_golang/prometheus"
4545
"go.uber.org/zap"
4646
"go.uber.org/zap/zapcore"
@@ -946,7 +946,7 @@ func (h adminHandler) originAllowed(origin *url.URL) bool {
946946

947947
// etagHasher returns a the hasher we used on the config to both
948948
// produce and verify ETags.
949-
func etagHasher() hash.Hash32 { return fnv.New32a() }
949+
func etagHasher() hash.Hash { return xxhash.New() }
950950

951951
// makeEtag returns an Etag header value (including quotes) for
952952
// the given config path and hash of contents at that path.

0 commit comments

Comments
 (0)