MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / validateURLScheme

Function validateURLScheme

pkg/go/cmd/codebase-memory-mcp/main.go:508–514  ·  view source on GitHub ↗

validateURLScheme rejects non-https URLs before any fetch (defense-in-depth).

(rawURL string)

Source from the content-addressed store, hash-verified

506
507// validateURLScheme rejects non-https URLs before any fetch (defense-in-depth).
508func validateURLScheme(rawURL string) error {
509 parsed, err := url.Parse(rawURL)
510 if err != nil || parsed.Scheme != "https" || parsed.Host == "" || parsed.User != nil {
511 return fmt.Errorf("refusing non-https URL: %s", rawURL)
512 }
513 return nil
514}
515
516// validateLoopbackURL accepts only plain HTTP to an exact loopback authority.
517func validateLoopbackURL(rawURL string) error {

Callers 2

main.goFile · 0.85
downloadClientFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected