From 54b11fbdabf57e24780b9b0cecec76504f44f451 Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez <835733+gaby@users.noreply.github.com> Date: Sun, 24 Mar 2024 16:12:17 -0400 Subject: [PATCH 1/2] Add application/zstd mime type --- http.go | 1 + http_test.go | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/http.go b/http.go index b2b0e6b..ed80825 100644 --- a/http.go +++ b/http.go @@ -232,6 +232,7 @@ var mimeExtensions = map[string]string{ "xhtml": "application/xhtml+xml", "xspf": "application/xspf+xml", "zip": "application/zip", + "zst": "application/zstd", "bin": "application/octet-stream", "exe": "application/octet-stream", "dll": "application/octet-stream", diff --git a/http_test.go b/http_test.go index d826bfc..5526fee 100644 --- a/http_test.go +++ b/http_test.go @@ -26,6 +26,12 @@ func Test_GetMIME(t *testing.T) { res = GetMIME("unknown") require.Equal(t, MIMEOctetStream, res) + res := GetMIME(".zst") + require.Equal(t, "application/zstd", res) + + res := GetMIME("zst") + require.Equal(t, "application/zstd", res) + // empty case res = GetMIME("") require.Equal(t, "", res) From 0d1cbbd180eaed7c1d392c96e14b41b0392fc38d Mon Sep 17 00:00:00 2001 From: Juan Calderon-Perez <835733+gaby@users.noreply.github.com> Date: Sun, 24 Mar 2024 16:15:18 -0400 Subject: [PATCH 2/2] Fix statement --- http_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http_test.go b/http_test.go index 5526fee..f960d7b 100644 --- a/http_test.go +++ b/http_test.go @@ -26,10 +26,10 @@ func Test_GetMIME(t *testing.T) { res = GetMIME("unknown") require.Equal(t, MIMEOctetStream, res) - res := GetMIME(".zst") + res = GetMIME(".zst") require.Equal(t, "application/zstd", res) - res := GetMIME("zst") + res = GetMIME("zst") require.Equal(t, "application/zstd", res) // empty case