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

Function validateURLScheme

pkg/go/cmd/codebase-memory-mcp/main.go:177–182  ·  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

175
176// validateURLScheme rejects non-https URLs before any fetch (defense-in-depth).
177func validateURLScheme(rawURL string) error {
178 if !strings.HasPrefix(rawURL, "https://") {
179 return fmt.Errorf("refusing non-https URL: %s", rawURL)
180 }
181 return nil
182}
183
184// httpsOnlyClient returns an HTTP client that rejects non-HTTPS redirects.
185var httpsOnlyClient = &http.Client{

Callers 2

httpGetFunction · 0.85
fetchChecksumsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected