Skip to content

Commit c5da3eb

Browse files
authored
Handle legitimate GHES cases
1 parent a715be2 commit c5da3eb

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/configuration/configuration.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,16 @@ 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 : `api.${base}`;
74+
if(base === DEFAULT_GITHUB_API) {
75+
return base;
76+
}
77+
78+
if(base.includes(".ghe.com")){
79+
return `api.${base}`
80+
}else{
81+
return `${base}/api/v3`;
82+
}
83+
7584
}
7685

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

0 commit comments

Comments
 (0)