fix: support windows specific zip mime type for template uploads (#15442)

![image](https://github.com/user-attachments/assets/15ae6dc4-84a3-4c20-b603-ed38cc14a250)
Despite being encoded the same, the API was previously rejecting zip
files with this MIME type.
This commit is contained in:
Ethan
2024-11-08 18:24:12 +11:00
committed by GitHub
parent 718722af1b
commit f7cbf5dd79
2 changed files with 17 additions and 4 deletions

View File

@ -43,6 +43,18 @@ func TestPostFiles(t *testing.T) {
require.NoError(t, err)
})
t.Run("InsertWindowsZip", func(t *testing.T) {
t.Parallel()
client := coderdtest.New(t, nil)
_ = coderdtest.CreateFirstUser(t, client)
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
defer cancel()
_, err := client.Upload(ctx, "application/x-zip-compressed", bytes.NewReader(archivetest.TestZipFileBytes()))
require.NoError(t, err)
})
t.Run("InsertAlreadyExists", func(t *testing.T) {
t.Parallel()
client := coderdtest.New(t, nil)