mirror of
https://github.com/Melorise/nPanel.git
synced 2026-11-07 14:49:35 +00:00
14 lines
332 B
Go
14 lines
332 B
Go
package middleware
|
|
|
|
import "strings"
|
|
|
|
func ShouldProxyToAgent(reqPath string) bool {
|
|
if strings.HasPrefix(reqPath, "/npanel/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
|
|
}
|