MCPcopy Index your code
hub / github.com/1Panel-dev/1Panel / HandleNotRoute

Function HandleNotRoute

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

Source from the content-addressed store, hash-verified

20var publicSharePagePattern = regexp.MustCompile(`^/s/[A-Za-z0-9]{10,16}$`)
21
22func HandleNotRoute(c *gin.Context) bool {
23 if !checkBindDomain(c) {
24 HandleNotSecurity(c, "err_domain")
25 return false
26 }
27 if !checkIPLimit(c) {
28 HandleNotSecurity(c, "err_ip_limit")
29 return false
30 }
31 if CanServeFrontendPath(c) {
32 ToIndexHtml(c)
33 return false
34 }
35 if isEntrancePath(c) {
36 ToIndexHtml(c)
37 return false
38 }
39 return true
40}
41
42func CheckSecurity(c *gin.Context) bool {
43 authService := service.NewIAuthService()

Callers

nothing calls this directly

Calls 6

checkBindDomainFunction · 0.85
HandleNotSecurityFunction · 0.85
checkIPLimitFunction · 0.85
CanServeFrontendPathFunction · 0.85
ToIndexHtmlFunction · 0.85
isEntrancePathFunction · 0.85

Tested by

no test coverage detected