Skip to content

Commit fed414f

Browse files
authored
Merge pull request #396 from github/proxima-fix
Update api/v3 postfix to api. prefix
2 parents d8facfa + d76d110 commit fed414f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/configuration/configuration.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,15 @@ export function useEnterprise(): boolean {
7171
export function getGitHubApiUri(): string {
7272
if (!useEnterprise()) return DEFAULT_GITHUB_API;
7373
const base = getConfiguration().get<string>("github-enterprise.uri", DEFAULT_GITHUB_API).replace(/\/$/, "");
74-
return base === DEFAULT_GITHUB_API ? base : `${base}/api/v3`;
74+
if (base === DEFAULT_GITHUB_API) {
75+
return base;
76+
}
77+
78+
if (base.endsWith(".ghe.com")) {
79+
return `api.${base}`;
80+
} else {
81+
return `${base}/api/v3`;
82+
}
7583
}
7684

7785
async function updateLanguageServerApiUrl(context: vscode.ExtensionContext) {

0 commit comments

Comments
 (0)