From cb997cc49c4c11ad2fd8724ec5f933ca8e56c46a Mon Sep 17 00:00:00 2001 From: 兔子 Date: Wed, 4 Sep 2019 16:37:03 +0800 Subject: [PATCH] fix path error at http2 --- vtqe/tools/http.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vtqe/tools/http.go b/vtqe/tools/http.go index 8c399ed..64c64ad 100644 --- a/vtqe/tools/http.go +++ b/vtqe/tools/http.go @@ -171,6 +171,9 @@ func ReadFolder(w http.ResponseWriter, r *http.Request, fullpath string, isroot if !isroot { w.Write([]byte(fmt.Sprintf("

%s %s

\n", "..", "..", "上层文件夹"))) } + if r.URL.Path == "/" { + r.URL.Path = "" + } for _, v := range dir { if v.Name() != "." || v.Name() != ".." { if !v.IsDir() {