MCPcopy Create free account
hub / github.com/ddev/ddev / isGitHubURL

Function isGitHubURL

pkg/github/github.go:123–133  ·  view source on GitHub ↗

isGitHubURL checks if the given URL is for GitHub or any subdomain of GitHub

(requestURL string)

Source from the content-addressed store, hash-verified

121
122// isGitHubURL checks if the given URL is for GitHub or any subdomain of GitHub
123func isGitHubURL(requestURL string) bool {
124 if requestURL == "" {
125 return false
126 }
127 u, err := url.Parse(requestURL)
128 if err != nil {
129 return false
130 }
131 host := strings.ToLower(u.Host)
132 return host == "github.com" || strings.HasSuffix(host, ".github.com")
133}
134
135// GetGitHubToken returns the GitHub token from the environment and the name of the variable it was found in.
136func GetGitHubToken() (string, string) {

Callers 2

GetGitHubHeadersFunction · 0.85
HasInvalidGitHubTokenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected