Skip to content

Commit 2b224c9

Browse files
authored
1 parent 5136342 commit 2b224c9

File tree

1 file changed

+18
-0
lines changed
  • src/vs/code/electron-main

1 file changed

+18
-0
lines changed

src/vs/code/electron-main/app.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,24 @@ export class CodeApplication extends Disposable {
301301

302302
//#endregion
303303

304+
//#region Allow CORS for the PRSS CDN
305+
306+
// https://github.com/microsoft/vscode-remote-release/issues/9246
307+
session.defaultSession.webRequest.onHeadersReceived((details, callback) => {
308+
if (details.url.startsWith('https://vscode.download.prss.microsoft.com/')) {
309+
const responseHeaders = details.responseHeaders ?? Object.create(null);
310+
311+
if (responseHeaders['Access-Control-Allow-Origin'] === undefined) {
312+
responseHeaders['Access-Control-Allow-Origin'] = ['*'];
313+
return callback({ cancel: false, responseHeaders });
314+
}
315+
}
316+
317+
return callback({ cancel: false });
318+
});
319+
320+
//#endregion
321+
304322
//#region Code Cache
305323

306324
type SessionWithCodeCachePathSupport = Session & {

0 commit comments

Comments
 (0)