Commit eb85e8e3 authored by astaxie's avatar astaxie

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

"
parent e2672049
...@@ -18,6 +18,7 @@ import ( ...@@ -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) { ...@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment