MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / IsFrontendPath

Function IsFrontendPath

core/utils/security/security.go:146–157  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

144}
145
146func IsFrontendPath(path string) bool {
147 reqUri := strings.TrimSuffix(path, "/")
148 if _, ok := constant.WebUrlMap[reqUri]; ok {
149 return true
150 }
151 for _, route := range constant.DynamicRoutes {
152 if match, _ := regexp.MatchString(route, reqUri); match {
153 return true
154 }
155 }
156 return false
157}
158
159func CanServeFrontendPath(c *gin.Context) bool {
160 if !IsFrontendPath(c.Request.URL.Path) {

Callers 1

CanServeFrontendPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected