mirror of
https://github.com/astaxie/beego.git
synced 2024-12-23 08:10:50 +00:00
code refactor
This commit is contained in:
parent
936cb735e1
commit
4995f91547
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user