File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
1010 type CrossOriginOpenerPolicyOptions ,
1111 crossOriginOpenerPolicy ,
1212} from "./rules/content/cross-origin-opener-policy.js" ;
13+ import { originAgentCluster } from "./rules/content/origin-agent-cluster.js" ;
1314import { xDownloadOptions } from "./rules/content/x-download-options.js" ;
1415import {
1516 type XFrameOptionsOptions ,
@@ -27,6 +28,10 @@ export function contentSecurity(
2728 headers : Headers ,
2829 options : ContentSecureOptions = { } ,
2930) {
31+ if ( options . originAgentCluster ?? true ) {
32+ originAgentCluster ( headers ) ;
33+ }
34+
3035 if ( options . xXssProtection ?? true ) {
3136 xXssProtection ( headers ) ;
3237 }
@@ -81,6 +86,7 @@ export function contentSecurity(
8186}
8287
8388export type ContentSecureOptions = {
89+ originAgentCluster ?: boolean ;
8490 contentSecurityPolicy ?: ContentSecurityPolicyOptions | boolean ;
8591 crossOriginOpenerPolicy ?: CrossOriginOpenerPolicyOptions | boolean ;
8692 crossOriginEmbedderPolicy ?: CrossOriginEmbedderPolicyOptions | boolean ;
Original file line number Diff line number Diff line change 11import { resourceSharingSecurity } from "./resourceSharing.js" ;
2- import { originAgentCluster } from "./rules/general/origin-agent-cluster.js" ;
32import {
43 type ReferrerPolicyOptions ,
54 referrerPolicy ,
@@ -29,10 +28,6 @@ export function generalSecurity(
2928 resourceSharingSecurity ( headers , { strategy : "same-origin" } ) ;
3029 }
3130
32- if ( options . originAgentCluster ?? true ) {
33- originAgentCluster ( headers ) ;
34- }
35-
3631 switch ( options . referrerPolicy ) {
3732 case undefined :
3833 case true :
@@ -87,7 +82,6 @@ export function generalSecurity(
8782
8883export type GeneralSecureOptions = {
8984 sameOrigin ?: boolean ;
90- originAgentCluster ?: boolean ;
9185 referrerPolicy ?: ReferrerPolicyOptions | boolean ;
9286 strictTransportSecurity ?: StrictTransportSecurityOptions | boolean ;
9387 xContentTypeOptions ?: boolean ;
File renamed without changes.
You can’t perform that action at this time.
0 commit comments