1
0
Fork 0

Add http-wasm plugin support to Traefik

This commit is contained in:
Jesse Haka 2023-11-30 22:42:06 +02:00 committed by GitHub
parent b2bb96390a
commit 6858dbdd07
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 338 additions and 119 deletions

View file

@ -279,7 +279,15 @@ func unzipFile(f *zipa.File, dest string) error {
defer func() { _ = rc.Close() }()
pathParts := strings.SplitN(f.Name, "/", 2)
p := filepath.Join(dest, pathParts[1])
var pp string
if len(pathParts) < 2 {
pp = pathParts[0]
} else {
pp = pathParts[1]
}
p := filepath.Join(dest, pp)
if f.FileInfo().IsDir() {
err = os.MkdirAll(p, f.Mode())