From 56313800672e7e4bda85c61d75f7e6b360a5f5a5 Mon Sep 17 00:00:00 2001 From: Ben Morrison Date: Thu, 19 Dec 2019 01:23:16 -0500 Subject: truncating etag --- svc/handlers.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'svc') diff --git a/svc/handlers.go b/svc/handlers.go index 11f7633..cd0d920 100644 --- a/svc/handlers.go +++ b/svc/handlers.go @@ -34,11 +34,13 @@ import ( func getEtagFromTime(modtime time.Time) string { shabytes, err := modtime.MarshalText() errLog("", err) - return fmt.Sprintf("%x", fnv.New32().Sum(shabytes)) + bytes := fnv.New32().Sum(shabytes) + return fmt.Sprintf("%x", bytes[:16]) } func getEtag(data []byte) string { - return fmt.Sprintf("%x", fnv.New32().Sum(data)) + bytes := fnv.New32().Sum(data) + return fmt.Sprintf("%x", bytes[:16]) } func servStatic(w http.ResponseWriter, isCSS bool) error { -- cgit 1.4.1-2-gfad0 ub'>Leo is a simple backup programAndinus <andinus@nand.sh>
about summary refs log blame commit diff stats
path: root/LICENSE
blob: 8cb51645a3f41b240015fe9ee6bce9a45910b6d1 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13