mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 07:20:55 +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
|
// 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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user