We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 497974a commit 5285f17Copy full SHA for 5285f17
cmd/rwp/main.go
@@ -1,7 +1,22 @@
1
package main
2
3
-import "github.com/readium/go-toolkit/cmd/rwp/cmd"
+import (
4
+ "os"
5
+
6
+ "github.com/readium/go-toolkit/cmd/rwp/cmd"
7
+)
8
9
func main() {
10
+ // From the archive/zip docs:
11
+ // If any file inside the archive uses a non-local name
12
+ // (as defined by [filepath.IsLocal]) or a name containing backslashes
13
+ // and the GODEBUG environment variable contains `zipinsecurepath=0`,
14
+ // NewReader returns the reader with an [ErrInsecurePath] error.
15
+ if os.Getenv("GODEBUG") == "" {
16
+ os.Setenv("GODEBUG", "zipinsecurepath=0")
17
+ } else {
18
+ os.Setenv("GODEBUG", os.Getenv("GODEBUG")+",zipinsecurepath=0")
19
+ }
20
21
cmd.Execute()
22
}
0 commit comments