support folder delete, prevent ghs.yml see

This commit is contained in:
codeskyblue
2018-09-18 13:35:10 +08:00
parent 40f02fba65
commit 0cacad260e
6 changed files with 79 additions and 10 deletions

3
zip.go
View File

@@ -91,6 +91,9 @@ func CompressToZip(w http.ResponseWriter, rootDir string) {
filepath.Walk(rootDir, func(path string, info os.FileInfo, err error) error {
zipPath := path[len(rootDir):]
if info.Name() == YAMLCONF { // ignore .ghs.yml for security
return nil
}
return zw.Add(zipPath, path)
})
}