mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 05:40:54 +00:00
update the isdir
This commit is contained in:
parent
8164367762
commit
f5f3395560
@ -68,7 +68,7 @@ func serverStaticRouter(ctx *context.Context) {
|
|||||||
if finfo.IsDir() && !DirectoryIndex {
|
if finfo.IsDir() && !DirectoryIndex {
|
||||||
middleware.Exception("403", ctx.ResponseWriter, ctx.Request, "403 Forbidden")
|
middleware.Exception("403", ctx.ResponseWriter, ctx.Request, "403 Forbidden")
|
||||||
return
|
return
|
||||||
} else if ctx.Input.Request.URL.Path[len(ctx.Input.Request.URL.Path)-1] != '/' {
|
} else if finfo.IsDir() && ctx.Input.Request.URL.Path[len(ctx.Input.Request.URL.Path)-1] != '/' {
|
||||||
http.Redirect(ctx.ResponseWriter, ctx.Request, ctx.Input.Request.URL.Path+"/", 302)
|
http.Redirect(ctx.ResponseWriter, ctx.Request, ctx.Input.Request.URL.Path+"/", 302)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user