1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-23 08:10:50 +00:00

code refactor

This commit is contained in:
JessonChan 2015-09-22 13:46:20 +08:00
parent 936cb735e1
commit 4995f91547

View File

@ -34,9 +34,9 @@ func serverStaticRouter(ctx *context.Context) {
// special processing : favicon.ico/robots.txt can be in any static dir
if requestPath == "/favicon.ico" || requestPath == "/robots.txt" {
if utils.FileExists("./" + requestPath) {
http.ServeFile(ctx.ResponseWriter, ctx.Request, "./"+requestPath)
file := path.Join(".", requestPath)
if utils.FileExists(file) {
http.ServeFile(ctx.ResponseWriter, ctx.Request, file)
return
}