fix the static file dir
Showing
1 changed file
with
3 additions
and
0 deletions
| ... | @@ -68,6 +68,9 @@ func serverStaticRouter(ctx *context.Context) { | ... | @@ -68,6 +68,9 @@ 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] != '/' { | ||
| 72 | http.Redirect(ctx.ResponseWriter, ctx.Request, ctx.Input.Request.URL.Path+"/", 302) | ||
| 73 | return | ||
| 71 | } | 74 | } |
| 72 | 75 | ||
| 73 | //This block obtained from (https://github.com/smithfox/beego) - it should probably get merged into astaxie/beego after a pull request | 76 | //This block obtained from (https://github.com/smithfox/beego) - it should probably get merged into astaxie/beego after a pull request | ... | ... |
-
Please register or sign in to post a comment