private static Path zipSlipProtect()

in src/main/java/org/apache/shenyu/util/FileUtil.java [100:110]


    private static Path zipSlipProtect(ArchiveEntry entry,Path targetDir) throws IOException {

        Path targetDirResolved = targetDir.resolve(entry.getName());
        Path normalizePath = targetDirResolved.normalize();

        if (!normalizePath.startsWith(targetDir)) {
            throw new IOException("Compressed file corrupted: " + entry.getName());
        }

        return normalizePath;
    }