mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 13:40:55 +00:00
code refactor
This commit is contained in:
parent
4995f91547
commit
9c17f73489
@ -82,7 +82,6 @@ func serverStaticRouter(ctx *context.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if strings.HasSuffix(requestPath, "/index.html") {
|
if strings.HasSuffix(requestPath, "/index.html") {
|
||||||
if utils.FileExists(filePath) {
|
|
||||||
fileReader, err := os.Open(filePath)
|
fileReader, err := os.Open(filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if RunMode == "dev" {
|
if RunMode == "dev" {
|
||||||
@ -95,7 +94,6 @@ func serverStaticRouter(ctx *context.Context) {
|
|||||||
http.ServeContent(ctx.ResponseWriter, ctx.Request, filePath, fileInfo.ModTime(), fileReader)
|
http.ServeContent(ctx.ResponseWriter, ctx.Request, filePath, fileInfo.ModTime(), fileReader)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
isStaticFileToCompress := false
|
isStaticFileToCompress := false
|
||||||
lowerFileName := strings.ToLower(filePath)
|
lowerFileName := strings.ToLower(filePath)
|
||||||
|
Loading…
Reference in New Issue
Block a user