mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 08:40:54 +00:00
path.Clean can't clean window separate .."
"
This commit is contained in:
parent
e26720496f
commit
eb85e8e328
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user