From 2500c267be1f4ba623f4d947f40fc0230ad57aa8 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Tue, 11 Oct 2016 20:44:33 -0700 Subject: [PATCH] ENH: Fix path joiner in zip func --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 8d751e6..06b1c94 100644 --- a/main.go +++ b/main.go @@ -9,6 +9,7 @@ import ( "os" "path/filepath" "regexp" + "strings" ) func rootHandler(w http.ResponseWriter, r *http.Request) { @@ -96,7 +97,8 @@ func Unzip(src, dest string) error { } }() - path := filepath.Join(dest, f.Name) + components := strings.Split(f.Name, "/") + path := filepath.Join(append([]string{dest}, components...)...) if f.FileInfo().IsDir() { os.MkdirAll(path, 0755)