diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts index 6a19766ca0..24ca25e817 100644 --- a/apps/desktop/electron/main.ts +++ b/apps/desktop/electron/main.ts @@ -262,6 +262,7 @@ import { } from './managed-ssh-update' import { registerMcpOauthCallbackIpc } from './mcp-oauth-callback-ipc' import { createMediaProtocolHandler, MEDIA_PROTOCOL } from './media-protocol' +import { fetchLocalMedia } from './media-range' import { createNativeAccessTokenCoordinator, NativeAuthChangedError } from './native-access-token' import { oauthSessionIsLive, resolveJsonBody, resolveReadinessProbeAuth } from './native-auth-decisions' import { @@ -1366,13 +1367,10 @@ protocol.registerSchemesAsPrivileged([ function registerMediaProtocol() { const handler = createMediaProtocolHandler({ ensureRemoteBearer: baseUrl => ensureNativeAccessToken(baseUrl), - fetchLocal: (resolvedPath, headers, method) => - electronNet.fetch(pathToFileURL(resolvedPath).toString(), { - bypassCustomProtocolHandlers: true, - credentials: 'omit', - headers, - method - }), + // Answer local files ourselves: Electron's file:// loader ignores Range and + // returns the whole body as 200 without Accept-Ranges, which makes