1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 05:30:55 +00:00

fix read /

This commit is contained in:
asta.xie 2014-03-12 18:29:45 +08:00
parent 6c92ca2a16
commit 624f6258ee

View File

@ -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):])