Skip to content

Commit c916727

Browse files
committed
feat(scan): --binary-only 上传 *.jar *.war
1 parent 4086f1d commit c916727

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

chunkupload/filter.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"io"
66
"io/fs"
77
"os"
8+
"path/filepath"
89
"strings"
910
)
1011

@@ -35,6 +36,10 @@ var BinaryOnly Filter = func(path string, entry fs.DirEntry) (FilterVote, error)
3536
if entry.IsDir() {
3637
return FilterAdd, nil
3738
}
39+
var ext = filepath.Ext(path)
40+
if strings.EqualFold(".jar", ext) || strings.EqualFold(".war", ext) {
41+
return FilterAdd, nil
42+
}
3843
eFormat, _ := detectFileFormat(path)
3944
if eFormat != "" {
4045
return FilterAdd, nil

0 commit comments

Comments
 (0)