MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / validateManifestSourceURL

Function validateManifestSourceURL

internal/pluginstore/manifest.go:158–174  ·  view source on GitHub ↗
(sourceURL string)

Source from the content-addressed store, hash-verified

156}
157
158func validateManifestSourceURL(sourceURL string) error {
159 sourceURL = strings.TrimSpace(sourceURL)
160 if sourceURL == "" {
161 return fmt.Errorf("missing required field source-url")
162 }
163 parsed, errParse := url.Parse(sourceURL)
164 if errParse != nil || parsed.Scheme == "" || parsed.Host == "" {
165 return fmt.Errorf("invalid source-url")
166 }
167 if parsed.Scheme != "https" && parsed.Scheme != "http" {
168 return fmt.Errorf("source-url must use http or https")
169 }
170 if hasSensitiveQueryParameter(parsed) {
171 return fmt.Errorf("source-url contains sensitive query parameter")
172 }
173 return nil
174}

Callers 1

ValidateMethod · 0.85

Calls 1

Tested by

no test coverage detected