1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 02:10:54 +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"
"os"
"path"
"path/filepath"
"strconv"
"strings"
@ -29,7 +30,7 @@ func serverStaticRouter(ctx *context.Context) {
if ctx.Input.Method() != "GET" && ctx.Input.Method() != "HEAD" {
return
}
requestPath := path.Clean(ctx.Input.Request.URL.Path)
requestPath := filepath.Clean(ctx.Input.Request.URL.Path)
i := 0
for prefix, staticDir := range StaticDir {
if len(prefix) == 0 {