From c1ad78d984bf6482635110f88c2fdb2b6017a044 Mon Sep 17 00:00:00 2001 From: Thomas Miceli Date: Thu, 23 Mar 2023 16:27:38 +0100 Subject: [PATCH] Add file header for zipped files --- internal/web/gist.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/web/gist.go b/internal/web/gist.go index 3d93799..5ea8804 100644 --- a/internal/web/gist.go +++ b/internal/web/gist.go @@ -465,7 +465,11 @@ func downloadZip(ctx echo.Context) error { zipWriter := zip.NewWriter(zipFile) for _, file := range files { - f, err := zipWriter.Create(file.Filename) + fh := &zip.FileHeader{ + Name: file.Filename, + Method: zip.Deflate, + } + f, err := zipWriter.CreateHeader(fh) if err != nil { return errorRes(500, "Error adding a file the to the zip archive", err) }