mirror of https://github.com/caddyserver/caddy.git
admin: Use xxhash for etag (#6207)
This commit is contained in:
parent
e0bf179c1a
commit
1217449609
4
admin.go
4
admin.go
|
@ -26,7 +26,6 @@ import (
|
||||||
"expvar"
|
"expvar"
|
||||||
"fmt"
|
"fmt"
|
||||||
"hash"
|
"hash"
|
||||||
"hash/fnv"
|
|
||||||
"io"
|
"io"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
@ -41,6 +40,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/caddyserver/certmagic"
|
"github.com/caddyserver/certmagic"
|
||||||
|
"github.com/cespare/xxhash/v2"
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
"go.uber.org/zap/zapcore"
|
"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
|
// etagHasher returns a the hasher we used on the config to both
|
||||||
// produce and verify ETags.
|
// 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
|
// makeEtag returns an Etag header value (including quotes) for
|
||||||
// the given config path and hash of contents at that path.
|
// the given config path and hash of contents at that path.
|
||||||
|
|
Loading…
Reference in New Issue