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 {
113
113
return ;
114
114
}
115
115
116
- this . setupCORSBypass ( ) ;
116
+ await this . setupCORSBypass ( ) ;
117
117
void this . setupCompassAuthService ( ) ;
118
118
this . setupAutoUpdate ( ) ;
119
119
await setupCSFLELibrary ( ) ;
@@ -306,7 +306,7 @@ class CompassApplication {
306
306
return this ;
307
307
}
308
308
309
- private static setupCORSBypass ( ) {
309
+ private static async setupCORSBypass ( ) {
310
310
const CLOUD_URLS_FILTER = {
311
311
urls : [
312
312
'*://cloud.mongodb.com/*' ,
@@ -340,6 +340,9 @@ class CompassApplication {
340
340
'access-control-max-age' ,
341
341
] ;
342
342
343
+ // Accessing defaultSession is not allowed when app is not ready
344
+ await app . whenReady ( ) ;
345
+
343
346
session . defaultSession . webRequest . onBeforeSendHeaders (
344
347
CLOUD_URLS_FILTER ,
345
348
( details , callback ) => {
You can’t perform that action at this time.
0 commit comments