feat(core): Allow specifying Content-Security-Policy-Report-Only (#15805)

This commit is contained in:
Mike Arvela
2025-05-29 09:26:24 +03:00
committed by GitHub
parent e860dd6d2e
commit c12784600f
3 changed files with 9 additions and 0 deletions

View File

@@ -32,4 +32,10 @@ export class SecurityConfig {
// TODO: create a new type that parses and validates this string into a strongly-typed object
@Env('N8N_CONTENT_SECURITY_POLICY')
contentSecurityPolicy: string = '{}';
/**
* Whether to set the `Content-Security-Policy-Report-Only` header instead of `Content-Security-Policy`.
*/
@Env('N8N_CONTENT_SECURITY_POLICY_REPORT_ONLY')
contentSecurityPolicyReportOnly: boolean = false;
}

View File

@@ -272,6 +272,7 @@ describe('GlobalConfig', () => {
blockFileAccessToN8nFiles: true,
daysAbandonedWorkflow: 90,
contentSecurityPolicy: '{}',
contentSecurityPolicyReportOnly: false,
},
executions: {
pruneData: true,