feat: Implement a pool monitoring dashboard and file upload functionality.
This commit is contained in:
@@ -264,9 +264,19 @@ func handleS2AProxy(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
// 提取路径: /api/s2a/proxy/xxx -> /api/v1/admin/xxx
|
||||
// 提取路径: /api/s2a/proxy/xxx -> 目标路径
|
||||
path := strings.TrimPrefix(r.URL.Path, "/api/s2a/proxy")
|
||||
targetURL := config.Global.S2AApiBase + "/api/v1/admin" + path
|
||||
|
||||
// 如果路径不是以 /api/ 开通的,默认补上 /api/v1/admin 开头(兼容 dashboard 统计等)
|
||||
// 如果已经是 /api/ 开头(如 /api/pool/polling),则保持原样
|
||||
var targetPath string
|
||||
if strings.HasPrefix(path, "/api/") {
|
||||
targetPath = path
|
||||
} else {
|
||||
targetPath = "/api/v1/admin" + path
|
||||
}
|
||||
|
||||
targetURL := config.Global.S2AApiBase + targetPath
|
||||
if r.URL.RawQuery != "" {
|
||||
targetURL += "?" + r.URL.RawQuery
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user