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" }