mirror of
https://github.com/microsoft/vscode.git
synced 2026-03-05 08:17:17 +00:00
Workaround electron proxy issues for GitHub by allowing to switch to node's fetch (#261099)
A user reported that their proxy ZScaller has issues with Electron's fetch. More research needs to be done to understand why this is not playing nice wholistically... ... but, to unblock GitHub scenarios like Copilot, we add this setting to change the implementation of fetch used. At some point, we need to have http.useElectronFetch setting be enabled by default and when that happens, this setting can be removed in favor of that. cc @chrmarti @alexdima
This commit is contained in:
committed by
GitHub
parent
2aa3c62fa7
commit
631a4d9dbb
@@ -3,10 +3,19 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { workspace } from 'vscode';
|
||||
|
||||
let _fetch: typeof fetch;
|
||||
try {
|
||||
_fetch = require('electron').net.fetch;
|
||||
} catch {
|
||||
|
||||
const useElectronFetch = workspace.getConfiguration('github-authentication').get<boolean>('useElectronFetch', true);
|
||||
if (useElectronFetch) {
|
||||
try {
|
||||
_fetch = require('electron').net.fetch;
|
||||
} catch {
|
||||
_fetch = fetch;
|
||||
}
|
||||
} else {
|
||||
_fetch = fetch;
|
||||
}
|
||||
|
||||
export const fetching = _fetch;
|
||||
|
||||
Reference in New Issue
Block a user