mirror of
https://github.com/microsoft/vscode.git
synced 2026-03-05 00:08:14 +00:00
Use Electron fetch or Node fetch for github-authentication to support proxies (#238149)
* Attempt to use Electron fetch for github-authentication Also changes fallback from node-fetch to the built-in Node fetch * Remove Content-Length header Electron compatibility It looks like it was set incorrectly to the body contents anyways.
This commit is contained in:
@@ -2,6 +2,11 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import fetch from 'node-fetch';
|
||||
|
||||
export const fetching = fetch;
|
||||
let _fetch: typeof fetch;
|
||||
try {
|
||||
_fetch = require('electron').net.fetch;
|
||||
} catch {
|
||||
_fetch = fetch;
|
||||
}
|
||||
export const fetching = _fetch;
|
||||
|
||||
Reference in New Issue
Block a user