@@ -332,6 +332,7 @@ describe('GlobalConfig', () => {
332332 daysAbandonedWorkflow : 90 ,
333333 contentSecurityPolicy : '{}' ,
334334 contentSecurityPolicyReportOnly : false ,
335+ crossOriginOpenerPolicy : 'same-origin' ,
335336 disableWebhookHtmlSandboxing : false ,
336337 disableBareRepos : true ,
337338 awsSystemCredentialsAccess : false ,
@@ -568,6 +569,24 @@ describe('GlobalConfig', () => {
568569 expect ( globalConfig . taskRunners . enabled ) . toEqual ( true ) ;
569570 expect ( globalConfig . database . type ) . toEqual ( 'postgresdb' ) ;
570571 } ) ;
572+
573+ it ( 'should validate crossOriginOpenerPolicy enum values' , ( ) => {
574+ process . env = {
575+ N8N_CROSS_ORIGIN_OPENER_POLICY : 'same-origin-allow-popups' ,
576+ } ;
577+
578+ const globalConfig = Container . get ( GlobalConfig ) ;
579+ expect ( globalConfig . security . crossOriginOpenerPolicy ) . toEqual ( 'same-origin-allow-popups' ) ;
580+ } ) ;
581+
582+ it ( 'should warn and fall back to default for invalid crossOriginOpenerPolicy' , ( ) => {
583+ process . env = {
584+ N8N_CROSS_ORIGIN_OPENER_POLICY : 'invalid-policy' ,
585+ } ;
586+
587+ const globalConfig = Container . get ( GlobalConfig ) ;
588+ expect ( globalConfig . security . crossOriginOpenerPolicy ) . toEqual ( 'same-origin' ) ;
589+ } ) ;
571590 } ) ;
572591
573592 describe ( 'health endpoint transformation' , ( ) => {
0 commit comments