mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-01 15:07:17 +08:00
appsrv: 反转义path segs
支持"climc network-delete 中文"
This commit is contained in:
@@ -21,6 +21,7 @@ import (
|
||||
"math/rand"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
@@ -234,6 +235,11 @@ func (app *Application) handleCORS(w http.ResponseWriter, r *http.Request) bool
|
||||
|
||||
func (app *Application) defaultHandle(w http.ResponseWriter, r *http.Request, rid string) (*SHandlerInfo, *SAppParams) {
|
||||
segs := SplitPath(r.URL.EscapedPath())
|
||||
for i := range segs {
|
||||
if p, err := url.PathUnescape(segs[i]); err == nil {
|
||||
segs[i] = p
|
||||
}
|
||||
}
|
||||
params := make(map[string]string)
|
||||
w.Header().Set("Server", "Yunion AppServer/Go/2018.4")
|
||||
w.Header().Set("X-Frame-Options", "SAMEORIGIN")
|
||||
|
||||
Reference in New Issue
Block a user