INNER CODE UNIT · Go

validateGitHubEndpoint

OWASP/wrongsecrets · scripts/sort_contibutors/main.go:408

func validateGitHubEndpoint(endpoint string) error {
	u, err := url.Parse(endpoint)
	if err != nil {
		return fmt.Errorf("invalid endpoint: %w", err)
	}

	if u.Scheme != "https" {
		return errors.New("invalid endpoint scheme")
	}

	if !strings.EqualFold(u.Hostname(), "api.github.com") {
		return errors.New("invalid endpoint host")
	}

	return nil
}

func mergeUsers(items []Contributor) ([]Contributor, []Contributor) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…