mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-25 12:47:14 +00:00
Fall back to alternate fetch implementation (#262181)
This commit is contained in:
@@ -177,6 +177,8 @@ export class GitHubServer implements IGitHubServer {
|
||||
try {
|
||||
// Defined here: https://docs.github.com/en/rest/apps/oauth-applications?apiVersion=2022-11-28#delete-an-app-token
|
||||
const result = await fetching(uri.toString(true), {
|
||||
logger: this._logger,
|
||||
expectJSON: false,
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
Accept: 'application/vnd.github+json',
|
||||
@@ -218,6 +220,8 @@ export class GitHubServer implements IGitHubServer {
|
||||
try {
|
||||
this._logger.info('Getting user info...');
|
||||
result = await fetching(this.getServerUri('/user').toString(), {
|
||||
logger: this._logger,
|
||||
expectJSON: true,
|
||||
headers: {
|
||||
Authorization: `token ${token}`,
|
||||
'User-Agent': `${vscode.env.appName} (${vscode.env.appHost})`
|
||||
@@ -276,6 +280,8 @@ export class GitHubServer implements IGitHubServer {
|
||||
|
||||
try {
|
||||
const result = await fetching('https://education.github.com/api/user', {
|
||||
logger: this._logger,
|
||||
expectJSON: true,
|
||||
headers: {
|
||||
Authorization: `token ${session.accessToken}`,
|
||||
'faculty-check-preview': 'true',
|
||||
@@ -316,6 +322,8 @@ export class GitHubServer implements IGitHubServer {
|
||||
let version: string;
|
||||
if (!isSupportedTarget(this._type, this._ghesUri)) {
|
||||
const result = await fetching(this.getServerUri('/meta').toString(), {
|
||||
logger: this._logger,
|
||||
expectJSON: true,
|
||||
headers: {
|
||||
Authorization: `token ${token}`,
|
||||
'User-Agent': `${vscode.env.appName} (${vscode.env.appHost})`
|
||||
|
||||
Reference in New Issue
Block a user