microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.18k stars 29.29k forks source link

Change the global `fetch` available in local extension hosts to be the one from Electron #228696

Open chrmarti opened 1 month ago

chrmarti commented 1 month ago

Discussion on an issue with manual redirects discovered by test failures in https://github.com/microsoft/vscode/pull/228476: https://github.com/electron/electron/issues/43715

Node.js chose to not follow the spec on the redirect response object which might make it difficult to use Electron's fetch as a drop-in replacement that should appear to extension the same way Node.js' fetch does.

chrmarti commented 1 month ago

Some headers need to be removed to not break existing use: https://github.com/microsoft/vscode/blob/527e41ff551bb1001d2f224c2dec2e2ea3b66832/src/vs/platform/request/node/requestService.ts#L197-L202

chrmarti commented 1 month ago

Additional limitations: https://github.com/electron/electron/pull/36733#issuecomment-1405615494