fix(desktop): honour the system proxy in main-process requests (#3270)

This commit is contained in:
Hampus authored and GitHub committed 2026-10-08 03:04:55 +02:00
1 parent 6de6be2358
commit 3071bc7525
16 files changed
+542 -19

No files matched your search

+4 -2
View File
@@ -10,6 +10,7 @@ import {
stageAppImageUpdate,
} from '@electron/main/AppImageUpdate';
import {relaunchStableLaunchPath} from '@electron/main/LinuxLaunchPath';
import {moduleNetworkFetch} from '@electron/main/ModuleNetworkFetch';
import {compareModuleVersions, parseModuleVersion} from '@electron/main/ModuleVersion';
import {getUpdateBaseUrl} from '@electron/main/ShellDownloadFormats';
import type {ShellUpdateCapability, ShellUpdatePlan} from '@electron/main/ShellUpdateCapability';
@@ -18,7 +19,7 @@ import {
readVelopackApplyAttempt,
recordVelopackApplyAttempt,
} from '@electron/main/UpdaterApplyState';
import {app, autoUpdater} from 'electron';
import {app, autoUpdater, net} from 'electron';
import type {UpdateInfo, VelopackAsset} from 'velopack';
const requireModule = createRequire(import.meta.url);
@@ -148,7 +149,7 @@ async function runVelopackSelfUpdate(control: SelfUpdateControl, hooks: ShellSel
}
async function fetchPublishedAppImage(): Promise<{version: string; sha256: string | null}> {
const response = await fetch(`${getUpdateBaseUrl()}/latest`, {
const response = await net.fetch(`${getUpdateBaseUrl()}/latest`, {
cache: 'no-store',
headers: {Accept: 'application/json', 'Cache-Control': 'no-cache'},
});
@@ -199,6 +200,7 @@ async function runAppImageSelfUpdate(
target,
url: `${getUpdateBaseUrl()}/${published.version}/appimage`,
expectedSha256: published.sha256,
fetchImpl: moduleNetworkFetch,
onProgress: ({transferred, total}) => {
if (control.isSettled() || total <= 0) return;
hooks.onDownloading(Math.min(100, (transferred / total) * 100));