mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-09-23 08:00:55 +00:00
* fix: harden agent socket and permission checks * chore: remove agent socket test * chore: remove redundant comments
14 lines
332 B
Go
14 lines
332 B
Go
package middleware
|
|
|
|
import "strings"
|
|
|
|
func ShouldProxyToAgent(reqPath string) bool {
|
|
if strings.HasPrefix(reqPath, "/1panel/swagger") || !strings.HasPrefix(reqPath, "/api/v2") {
|
|
return false
|
|
}
|
|
if strings.HasPrefix(reqPath, "/api/v2/core") && !strings.HasPrefix(reqPath, "/api/v2/core/xpack") {
|
|
return false
|
|
}
|
|
return true
|
|
}
|