MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / validateURL

Function validateURL

setting/console_setting/validation.go:33–41  ·  view source on GitHub ↗
(urlStr string, index int, itemType string)

Source from the content-addressed store, hash-verified

31}
32
33func validateURL(urlStr string, index int, itemType string) error {
34 if !urlRegex.MatchString(urlStr) {
35 return fmt.Errorf("第%d个%s的URL格式不正确", index, itemType)
36 }
37 if _, err := url.Parse(urlStr); err != nil {
38 return fmt.Errorf("第%d个%s的URL无法解析:%s", index, itemType, err.Error())
39 }
40 return nil
41}
42
43func checkDangerousContent(content string, index int, itemType string) error {
44 lower := strings.ToLower(content)

Callers 2

validateApiInfoFunction · 0.85
validateUptimeKumaGroupsFunction · 0.85

Calls 1

ErrorMethod · 0.80

Tested by

no test coverage detected