Skip to content

Commit d71e2cd

Browse files
committed
move originAgentCluster to content
1 parent 7b8f8a4 commit d71e2cd

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/content.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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";
1314
import { xDownloadOptions } from "./rules/content/x-download-options.js";
1415
import {
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

8388
export type ContentSecureOptions = {
89+
originAgentCluster?: boolean;
8490
contentSecurityPolicy?: ContentSecurityPolicyOptions | boolean;
8591
crossOriginOpenerPolicy?: CrossOriginOpenerPolicyOptions | boolean;
8692
crossOriginEmbedderPolicy?: CrossOriginEmbedderPolicyOptions | boolean;

src/general.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { resourceSharingSecurity } from "./resourceSharing.js";
2-
import { originAgentCluster } from "./rules/general/origin-agent-cluster.js";
32
import {
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

8883
export type GeneralSecureOptions = {
8984
sameOrigin?: boolean;
90-
originAgentCluster?: boolean;
9185
referrerPolicy?: ReferrerPolicyOptions | boolean;
9286
strictTransportSecurity?: StrictTransportSecurityOptions | boolean;
9387
xContentTypeOptions?: boolean;

0 commit comments

Comments
 (0)