1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 07:20:55 +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 // special processing : favicon.ico/robots.txt can be in any static dir
if requestPath == "/favicon.ico" || requestPath == "/robots.txt" { if requestPath == "/favicon.ico" || requestPath == "/robots.txt" {
file := path.Join(".", requestPath)
if utils.FileExists("./" + requestPath) { if utils.FileExists(file) {
http.ServeFile(ctx.ResponseWriter, ctx.Request, "./"+requestPath) http.ServeFile(ctx.ResponseWriter, ctx.Request, file)
return return
} }