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

Function CanServeFrontendPath

core/utils/security/security.go:159–171  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

157}
158
159func CanServeFrontendPath(c *gin.Context) bool {
160 if !IsFrontendPath(c.Request.URL.Path) {
161 return false
162 }
163 if isPublicFileSharePagePath(c.Request.URL.Path) {
164 return true
165 }
166 authService := service.NewIAuthService()
167 if authService.GetSecurityEntrance() != "" {
168 return checkEntrance(c) || authService.IsLogin(c)
169 }
170 return true
171}
172
173func isPublicFileSharePagePath(path string) bool {
174 reqUri := strings.TrimSuffix(path, "/")

Callers 1

HandleNotRouteFunction · 0.85

Calls 5

GetSecurityEntranceMethod · 0.95
IsLoginMethod · 0.95
IsFrontendPathFunction · 0.85
checkEntranceFunction · 0.85

Tested by

no test coverage detected