Skip to content

Commit 1e54771

Browse files
authored
Remove overly-aggressive filetype guards when extracting archives (#966)
Signed-off-by: egibs <20933572+egibs@users.noreply.github.com>
1 parent 83da18c commit 1e54771

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

pkg/archive/archive.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,6 @@ func extractNestedArchive(ctx context.Context, d string, f string, extracted *sy
6060
return fmt.Errorf("failed to determine file type: %w", err)
6161
}
6262

63-
// Empty filetypes or invalid MIME types should not be evaluated via `extract`
64-
if ft == nil || (ft != nil && ft.MIME == "") {
65-
return nil
66-
}
67-
6863
switch {
6964
case ft != nil && ft.MIME == "application/x-upx":
7065
isArchive = true
@@ -153,11 +148,6 @@ func ExtractArchiveToTempDir(ctx context.Context, path string) (string, error) {
153148
return "", fmt.Errorf("failed to determine file type: %w", err)
154149
}
155150

156-
// Empty filetypes or invalid MIME types should not be evaluated via `extract`
157-
if ft == nil || (ft != nil && ft.MIME == "") {
158-
return "", fmt.Errorf("unsupported archive type: %s", path)
159-
}
160-
161151
switch {
162152
case ft != nil && ft.MIME == "application/zlib":
163153
extract = ExtractZlib

0 commit comments

Comments
 (0)