mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-09-22 16:00:51 +00:00
25 lines
543 B
Go
25 lines
543 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
|
|
}
|
|
|
|
func IsPublicFileShareAPI(reqPath string) bool {
|
|
switch reqPath {
|
|
case "/api/v2/files/share/info",
|
|
"/api/v2/files/share/check",
|
|
"/api/v2/files/share/download":
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|