diff --git a/pkg/action/archive.go b/pkg/action/archive.go index e46f65409..e84d8b30b 100644 --- a/pkg/action/archive.go +++ b/pkg/action/archive.go @@ -263,7 +263,7 @@ func extractGzip(ctx context.Context, d string, f string) error { if _, err := io.Copy(ef, io.LimitReader(gr, maxBytes)); err != nil { return fmt.Errorf("failed to copy file: %w", err) } - case "zlib": + case "Z": zr, err := zlib.NewReader(gf) if err != nil { return fmt.Errorf("failed to create zlib reader: %w", err) diff --git a/pkg/programkind/programkind.go b/pkg/programkind/programkind.go index 918e7c8bc..e0fe6e153 100644 --- a/pkg/programkind/programkind.go +++ b/pkg/programkind/programkind.go @@ -18,6 +18,7 @@ import ( // file extension to MIME type, if it's a good scanning target. var supportedKind = map[string]string{ "7z": "", + "Z": "application/zlib", "asm": "", "bash": "application/x-bsh", "bat": "application/bat", @@ -58,9 +59,9 @@ var supportedKind = map[string]string{ "pyc": "application/x-python-code", "rb": "text/x-ruby", "rs": "text/x-rust", - "script": "text/x-generic-script", "scpt": "application/x-applescript", "scptd": "application/x-applescript", + "script": "text/x-generic-script", "service": "text/x-systemd", "sh": "application/x-sh", "so": "application/x-sharedlib", @@ -69,7 +70,6 @@ var supportedKind = map[string]string{ "yaml": "", "yara": "", "yml": "", - "zlib": "application/zlib", "zsh": "application/x-zsh", } @@ -183,7 +183,7 @@ func File(path string) (*FileType, error) { case hdr[0] == '\x1f' && hdr[1] == '\x8b': return Path(".gzip"), nil case hdr[0] == '\x78' && hdr[1] == '\x5E': - return Path(".zlib"), nil + return Path(".Z"), nil } return nil, nil }