From a10e983a5911a883d5683f010d0265e7fefc83d8 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 30 May 2020 17:28:39 +0200 Subject: [PATCH] Add zstandard (zstd, .zst) support --- fileserver.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fileserver.go b/fileserver.go index fb33224..0ad645a 100644 --- a/fileserver.go +++ b/fileserver.go @@ -12,11 +12,13 @@ import ( ) // List of encodings we would prefer to use, in order of preference, best first. -var preferredEncodings = []string{"br", "gzip", "identity"} +var preferredEncodings = []string{"zstd", "br", "gzip", "identity"} // File extension to use for different encodings. func extensionForEncoding(encname string) string { switch encname { + case "zstd": + return ".zst" case "gzip": return ".gz" case "br":