Test: pkg/task / Fix: failed test due to policy cache

This commit is contained in:
HFO4
2020-02-07 11:47:52 +08:00
parent fc5b7d42c8
commit 4c530a26a0
14 changed files with 309 additions and 57 deletions

View File

@@ -259,7 +259,7 @@ func (fs *FileSystem) Decompress(ctx context.Context, src, dst string) error {
rawPath := util.FormSlash(f.Name)
savePath := path.Join(dst, rawPath)
// 路径是否合法
if !strings.HasPrefix(savePath, path.Clean(dst)+"/") {
if !strings.HasPrefix(savePath, util.FillSlash(path.Clean(dst))) {
return fmt.Errorf("%s: illegal file path", f.Name)
}