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
1 changed files with 2 additions and 1 deletions

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 {