1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 20:51:29 +00:00

path.Clean can't clean window separate .."

"
This commit is contained in:
astaxie 2015-09-20 19:59:30 +08:00
parent e26720496f
commit eb85e8e328

View File

@ -18,6 +18,7 @@ import (
"net/http" "net/http"
"os" "os"
"path" "path"
"path/filepath"
"strconv" "strconv"
"strings" "strings"
@ -29,7 +30,7 @@ func serverStaticRouter(ctx *context.Context) {
if ctx.Input.Method() != "GET" && ctx.Input.Method() != "HEAD" { if ctx.Input.Method() != "GET" && ctx.Input.Method() != "HEAD" {
return return
} }
requestPath := path.Clean(ctx.Input.Request.URL.Path) requestPath := filepath.Clean(ctx.Input.Request.URL.Path)
i := 0 i := 0
for prefix, staticDir := range StaticDir { for prefix, staticDir := range StaticDir {
if len(prefix) == 0 { if len(prefix) == 0 {