@marcel91200 / caddy Mirror · read-only / commits / 12174496
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 12, 14:30 UTC

admin: Use xxhash for etag (#6207)

Hayder committed Mar 30, 2024 at 09:24 UTC 1217449609050471dfb70fdf35c9a22d738e2bef
1 file changed +2 -2
admin.go
+2 -2
@@ -26,7 +26,6 @@ import (
26 "expvar"
27 "fmt"
28 "hash"
29 - "hash/fnv"
29 "io"
30 "net"
31 "net/http"
@@ -41,6 +40,7 @@ import (
40 "time"
41
42 "github.com/caddyserver/certmagic"
43 + "github.com/cespare/xxhash/v2"
44 "github.com/prometheus/client_golang/prometheus"
45 "go.uber.org/zap"
46 "go.uber.org/zap/zapcore"
@@ -946,7 +946,7 @@ func (h adminHandler) originAllowed(origin *url.URL) bool {
946
947 // etagHasher returns a the hasher we used on the config to both
948 // produce and verify ETags.
949 -func etagHasher() hash.Hash32 { return fnv.New32a() }
949 +func etagHasher() hash.Hash { return xxhash.New() }
950
951 // makeEtag returns an Etag header value (including quotes) for
952 // the given config path and hash of contents at that path.