about summary refs log tree commit diff stats
path: root/svc/handlers.go
diff options
context:
space:
mode:
Diffstat (limited to 'svc/handlers.go')
-rw-r--r--svc/handlers.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/svc/handlers.go b/svc/handlers.go
index ee58622..7ce4b77 100644
--- a/svc/handlers.go
+++ b/svc/handlers.go
@@ -45,6 +45,12 @@ func getEtagFromTime(modtime time.Time) string {
 // responses.
 func getEtag(data []byte) string {
 	bytes := fnv.New32().Sum(data)
+	if bytes == nil {
+		return ""
+	}
+	if len(bytes) < 16 {
+		return fmt.Sprintf("%x", bytes)
+	}
 	return fmt.Sprintf("%x", bytes[:16])
 }