File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
packages/compass/src/main Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ class CompassApplication {
113113 return ;
114114 }
115115
116- this . setupCORSBypass ( ) ;
116+ await this . setupCORSBypass ( ) ;
117117 void this . setupCompassAuthService ( ) ;
118118 this . setupAutoUpdate ( ) ;
119119 await setupCSFLELibrary ( ) ;
@@ -306,7 +306,7 @@ class CompassApplication {
306306 return this ;
307307 }
308308
309- private static setupCORSBypass ( ) {
309+ private static async setupCORSBypass ( ) {
310310 const CLOUD_URLS_FILTER = {
311311 urls : [
312312 '*://cloud.mongodb.com/*' ,
@@ -340,6 +340,9 @@ class CompassApplication {
340340 'access-control-max-age' ,
341341 ] ;
342342
343+ // Accessing defaultSession is not allowed when app is not ready
344+ await app . whenReady ( ) ;
345+
343346 session . defaultSession . webRequest . onBeforeSendHeaders (
344347 CLOUD_URLS_FILTER ,
345348 ( details , callback ) => {
You can’t perform that action at this time.
0 commit comments