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

Function checkBindDomain

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

Source from the content-addressed store, hash-verified

176}
177
178func checkBindDomain(c *gin.Context) bool {
179 settingRepo := repo.NewISettingRepo()
180 status, _ := settingRepo.Get(repo.WithByKey("BindDomain"))
181 if len(status.Value) == 0 {
182 return true
183 }
184 domains := c.Request.Host
185 parts := strings.Split(c.Request.Host, ":")
186 if len(parts) > 0 {
187 domains = parts[0]
188 }
189 return domains == status.Value
190}
191
192func checkIPLimit(c *gin.Context) bool {
193 settingRepo := repo.NewISettingRepo()

Callers 2

HandleNotRouteFunction · 0.85
CheckSecurityFunction · 0.85

Calls 2

GetMethod · 0.95
WithByKeyMethod · 0.65

Tested by

no test coverage detected