Fixes file in gzip when downloading

This commit is contained in:
Amir Raminfar
2021-11-27 13:40:49 -08:00
parent da35a13d04
commit 34232ef956

View File

@@ -51,7 +51,7 @@ func (h *handler) downloadLogs(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/gzip")
zw := gzip.NewWriter(w)
defer zw.Close()
zw.Name = fmt.Sprintf("%v.log", container.ID)
zw.Name = fmt.Sprintf("%s-%s.log", container.Name, now.Format("2006-01-02T15-04-05"))
zw.Comment = "Logs generated by Dozzle"
zw.ModTime = now