Use API URL when connecting to GitHub:Enterprise When using a hosted GitHub (e.g. GitHub:Enterprise) we need to make sure the URL is used not only for the OAuth handshake but also for the GitHub API endpoint. Change-Id: I7904b8cb0a00f6e375826f3a0674c6a341c0e112
diff --git a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubLogin.java b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubLogin.java index 081d6c1..f9afeeb 100644 --- a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubLogin.java +++ b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubLogin.java
@@ -136,7 +136,7 @@ } public GitHub getHub() throws IOException { - return GitHub.connectUsingOAuth(this.token.accessToken); + return GitHub.connectUsingOAuth(config.gitHubApiUrl, token.accessToken); } private String getScopesKey(HttpServletRequest request,