From f5f339556075d83bc655b6b9580ec0ffcfbeb440 Mon Sep 17 00:00:00 2001 From: astaxie Date: Wed, 24 Sep 2014 14:48:08 +0800 Subject: [PATCH] update the isdir --- staticfile.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staticfile.go b/staticfile.go index a5f6b65c..96c97367 100644 --- a/staticfile.go +++ b/staticfile.go @@ -68,7 +68,7 @@ func serverStaticRouter(ctx *context.Context) { if finfo.IsDir() && !DirectoryIndex { middleware.Exception("403", ctx.ResponseWriter, ctx.Request, "403 Forbidden") 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) return }