Skip to content

Commit

Permalink
Add application/zstd mime type
Browse files Browse the repository at this point in the history
  • Loading branch information
gaby committed Mar 24, 2024
1 parent 7008899 commit 54b11fb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ func Test_GetMIME(t *testing.T) {
res = GetMIME("unknown")
require.Equal(t, MIMEOctetStream, res)

res := GetMIME(".zst")

Check failure on line 29 in http_test.go

View workflow job for this annotation

GitHub Actions / Compare

no new variables on left side of :=

Check failure on line 29 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.22.x, ubuntu-latest)

no new variables on left side of :=

Check failure on line 29 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.22.x, ubuntu-latest)

no new variables on left side of :=

Check failure on line 29 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.22.x, ubuntu-latest)

no new variables on left side of :=

Check failure on line 29 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.21.x, ubuntu-latest)

no new variables on left side of :=

Check failure on line 29 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.21.x, ubuntu-latest)

no new variables on left side of :=

Check failure on line 29 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.21.x, ubuntu-latest)

no new variables on left side of :=

Check failure on line 29 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.20.x, ubuntu-latest)

no new variables on left side of :=

Check failure on line 29 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.20.x, ubuntu-latest)

no new variables on left side of :=

Check failure on line 29 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.20.x, ubuntu-latest)

no new variables on left side of :=

Check failure on line 29 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.21.x, macos-latest)

no new variables on left side of :=

Check failure on line 29 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.21.x, macos-latest)

no new variables on left side of :=

Check failure on line 29 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.21.x, macos-latest)

no new variables on left side of :=

Check failure on line 29 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.20.x, macos-latest)

no new variables on left side of :=

Check failure on line 29 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.20.x, macos-latest)

no new variables on left side of :=
require.Equal(t, "application/zstd", res)

res := GetMIME("zst")

Check failure on line 32 in http_test.go

View workflow job for this annotation

GitHub Actions / Compare

no new variables on left side of :=

Check failure on line 32 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.22.x, ubuntu-latest)

no new variables on left side of :=

Check failure on line 32 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.22.x, ubuntu-latest)

no new variables on left side of :=

Check failure on line 32 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.22.x, ubuntu-latest)

no new variables on left side of :=

Check failure on line 32 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.21.x, ubuntu-latest)

no new variables on left side of :=

Check failure on line 32 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.21.x, ubuntu-latest)

no new variables on left side of :=

Check failure on line 32 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.21.x, ubuntu-latest)

no new variables on left side of :=

Check failure on line 32 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.20.x, ubuntu-latest)

no new variables on left side of :=

Check failure on line 32 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.20.x, ubuntu-latest)

no new variables on left side of :=

Check failure on line 32 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.20.x, ubuntu-latest)

no new variables on left side of :=

Check failure on line 32 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.21.x, macos-latest)

no new variables on left side of :=

Check failure on line 32 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.21.x, macos-latest)

no new variables on left side of :=

Check failure on line 32 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.21.x, macos-latest)

no new variables on left side of :=

Check failure on line 32 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.20.x, macos-latest)

no new variables on left side of :=

Check failure on line 32 in http_test.go

View workflow job for this annotation

GitHub Actions / Build (1.20.x, macos-latest)

no new variables on left side of :=
require.Equal(t, "application/zstd", res)

// empty case
res = GetMIME("")
require.Equal(t, "", res)
Expand Down

0 comments on commit 54b11fb

Please # to comment.