From c674f7e24361b64519558ffa14b019b6151ea48f Mon Sep 17 00:00:00 2001 From: Michael Kaye <1917473+michaelkaye@users.noreply.github.com> Date: Mon, 24 Jan 2022 13:41:36 +0000 Subject: [PATCH] Update comment to be accurate. --- submit.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/submit.go b/submit.go index 9b5d3c8..0554a4f 100644 --- a/submit.go +++ b/submit.go @@ -435,10 +435,13 @@ func saveLogPart(logNum int, filename string, reader io.Reader, reportDir string // some clients use sensible names (foo.N.log), which we preserve. For // others, we just make up a filename. // - // Either way, we need to append .gz, because we're compressing it. + // We append a ".gz" extension if not already present, as the final file we store on + // disk will be gzipped. The original filename may or may not contain a '.gz' depending + // on the client that uploaded it, and if it was uploaded already compressed. + var leafName string if logRegexp.MatchString(filename) { - leafName = filename + leafName = filename if !strings.HasSuffix(filename, ".gz") { leafName += ".gz" }