diff --git a/vcs-test/vcweb/auth.go b/vcs-test/vcweb/auth.go index d6ba58d8..09e3237e 100644 --- a/vcs-test/vcweb/auth.go +++ b/vcs-test/vcweb/auth.go @@ -113,5 +113,5 @@ func (h *authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } - http.FileServer(h.dir).ServeHTTP(w, r) + http.StripPrefix("/auth/", http.FileServer(h.dir)).ServeHTTP(w, r) } diff --git a/vcs-test/vcweb/load.go b/vcs-test/vcweb/load.go index b9aa357e..f4b3d7fe 100644 --- a/vcs-test/vcweb/load.go +++ b/vcs-test/vcweb/load.go @@ -16,7 +16,6 @@ import ( "log" "os" "path/filepath" - "strings" "sync" "time" @@ -119,10 +118,11 @@ func loadFS(dir1, dir2 string, force bool) { check(os.MkdirAll(tmp, 0777)) for _, f := range zr.File { - if strings.HasSuffix(f.Name, "/") { + if f.FileInfo().IsDir() { check(os.MkdirAll(filepath.Join(tmp, f.Name), 0777)) continue } + check(os.MkdirAll(filepath.Join(tmp, filepath.Dir(f.Name)), 0777)) w, err := os.Create(filepath.Join(tmp, f.Name)) check(err) r, err := f.Open() diff --git a/vcs-test/vcweb/main.go b/vcs-test/vcweb/main.go index 4ceafed5..0d5f84c0 100644 --- a/vcs-test/vcweb/main.go +++ b/vcs-test/vcweb/main.go @@ -42,6 +42,7 @@ func usage() { } var isLoadDir = map[string]bool{ + "auth": true, "go": true, "git": true, "hg": true,