diff --git a/lib/auth/github.go b/lib/auth/github.go index ea9a1539705b6..5963d2f5a1c0e 100644 --- a/lib/auth/github.go +++ b/lib/auth/github.go @@ -980,7 +980,7 @@ func (c *githubAPIClient) get(page string) ([]byte, string, error) { // formatGithubURL is a helper for formatting github api request URLs. func formatGithubURL(host string, path string) string { - return fmt.Sprintf("https://%s/%s", host, strings.TrimPrefix(path, "/")) + return fmt.Sprintf("https://api.%s/%s", host, strings.TrimPrefix(path, "/")) } const ( diff --git a/lib/auth/github_test.go b/lib/auth/github_test.go index eca56e149e35a..dafcab05da009 100644 --- a/lib/auth/github_test.go +++ b/lib/auth/github_test.go @@ -543,17 +543,17 @@ func TestGithubURLFormat(t *testing.T) { { host: "example.com", path: "foo/bar", - expect: "https://example.com/foo/bar", + expect: "https://api.example.com/foo/bar", }, { host: "example.com", path: "/foo/bar?spam=eggs", - expect: "https://example.com/foo/bar?spam=eggs", + expect: "https://api.example.com/foo/bar?spam=eggs", }, { host: "example.com", path: "/foo/bar", - expect: "https://example.com/foo/bar", + expect: "https://api.example.com/foo/bar", }, }