mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 12:50:55 +00:00
fix #2142
This commit is contained in:
parent
0ef357ebd7
commit
a32241e7d3
@ -196,9 +196,11 @@ func lookupFile(ctx *context.Context) (bool, string, os.FileInfo, error) {
|
|||||||
if !fi.IsDir() {
|
if !fi.IsDir() {
|
||||||
return false, fp, fi, err
|
return false, fp, fi, err
|
||||||
}
|
}
|
||||||
ifp := filepath.Join(fp, "index.html")
|
if requestURL := ctx.Input.URL(); requestURL[len(requestURL)-1] == '/' {
|
||||||
if ifi, _ := os.Stat(ifp); ifi != nil && ifi.Mode().IsRegular() {
|
ifp := filepath.Join(fp, "index.html")
|
||||||
return false, ifp, ifi, err
|
if ifi, _ := os.Stat(ifp); ifi != nil && ifi.Mode().IsRegular() {
|
||||||
|
return false, ifp, ifi, err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return !BConfig.WebConfig.DirectoryIndex, fp, fi, err
|
return !BConfig.WebConfig.DirectoryIndex, fp, fi, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user