Commit 624f6258 authored by asta.xie's avatar asta.xie

fix read /

parent 6c92ca2a
......@@ -555,7 +555,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
}
}
if strings.HasPrefix(r.URL.Path, prefix) {
if len(r.URL.Path) > len(prefix) && r.URL.Path[len(prefix)+1] != '/' {
if len(r.URL.Path) > len(prefix) && r.URL.Path[len(prefix)] != '/' {
continue
}
file := path.Join(staticDir, r.URL.Path[len(prefix):])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment