f5f33955 by astaxie

update the isdir

1 parent 81643677
...@@ -68,7 +68,7 @@ func serverStaticRouter(ctx *context.Context) { ...@@ -68,7 +68,7 @@ func serverStaticRouter(ctx *context.Context) {
68 if finfo.IsDir() && !DirectoryIndex { 68 if finfo.IsDir() && !DirectoryIndex {
69 middleware.Exception("403", ctx.ResponseWriter, ctx.Request, "403 Forbidden") 69 middleware.Exception("403", ctx.ResponseWriter, ctx.Request, "403 Forbidden")
70 return 70 return
71 } else if ctx.Input.Request.URL.Path[len(ctx.Input.Request.URL.Path)-1] != '/' { 71 } else if finfo.IsDir() && ctx.Input.Request.URL.Path[len(ctx.Input.Request.URL.Path)-1] != '/' {
72 http.Redirect(ctx.ResponseWriter, ctx.Request, ctx.Input.Request.URL.Path+"/", 302) 72 http.Redirect(ctx.ResponseWriter, ctx.Request, ctx.Input.Request.URL.Path+"/", 302)
73 return 73 return
74 } 74 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!