File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
src/vs/code/electron-main Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -301,6 +301,24 @@ export class CodeApplication extends Disposable {
301
301
302
302
//#endregion
303
303
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
+
304
322
//#region Code Cache
305
323
306
324
type SessionWithCodeCachePathSupport = Session & {
You can’t perform that action at this time.
0 commit comments