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

Function downloadBase

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

downloadBase returns the release download base and whether it is a loopback HTTP base. CBM_DOWNLOAD_URL replaces the GitHub release base (for testing) with install.sh's policy: HTTPS, or plain HTTP to an exact loopback authority.

(override string)

Source from the content-addressed store, hash-verified

488// testing) with install.sh's policy: HTTPS, or plain HTTP to an exact
489// loopback authority.
490func downloadBase(override string) (string, bool, error) {
491 if override == "" {
492 return fmt.Sprintf(
493 "https://github.com/%s/releases/download/v%s", repo, installVersion,
494 ), false, nil
495 }
496 if strings.HasPrefix(override, "https://") {
497 return override, false, nil
498 }
499 if loopbackHTTPURL.MatchString(override) {
500 return override, true, nil
501 }
502 return "", false, fmt.Errorf(
503 "refusing non-HTTPS download URL (CBM_DOWNLOAD_URL): %s", override,
504 )
505}
506
507// validateURLScheme rejects non-https URLs before any fetch (defense-in-depth).
508func validateURLScheme(rawURL string) error {

Callers 2

downloadFunction · 0.85

Calls

no outgoing calls