SecurityHeadersOptionsType
이 콘텐츠는 아직 번역되지 않았습니다.
SecurityHeadersOptionsType =
object
Defined in: src/http/middleware/SecurityHeadersOptions.ts:15
Plain settings shape for the security-headers bundle.
Properties
Section titled “Properties”contentTypeOptions?
Section titled “contentTypeOptions?”
readonlyoptionalcontentTypeOptions?:boolean
Defined in: src/http/middleware/SecurityHeadersOptions.ts:32
X-Content-Type-Options: nosniff. Default true.
false is honoured server-wide only —
newServerAt(…).withSecurityHeaders({ contentTypeOptions: false })
replaces the backend’s default header map, so the header stops being
written. On the securityHeaders() middleware it has no visible effect:
since #127 every backend writes nosniff ahead of every response it
emits, and a middleware can only add headers, never take one away. So
the response still carries it (#1060).
There is no route to “nosniff off for this subtree” — deliberately. The header is per-response and the backend’s copy is the last word, which is the point of putting it there: the backend’s own 404, its body-parse 413 and every error short-circuit never pass through a middleware at all.
crossOriginEmbedderPolicy?
Section titled “crossOriginEmbedderPolicy?”
readonlyoptionalcrossOriginEmbedderPolicy?:"require-corp"|"credentialless"|false
Defined in: src/http/middleware/SecurityHeadersOptions.ts:44
Cross-Origin-Embedder-Policy. Default false (breaks embeds; opt-in).
crossOriginOpenerPolicy?
Section titled “crossOriginOpenerPolicy?”
readonlyoptionalcrossOriginOpenerPolicy?:"same-origin"|"same-origin-allow-popups"|"unsafe-none"|false
Defined in: src/http/middleware/SecurityHeadersOptions.ts:40
Cross-Origin-Opener-Policy. Default 'same-origin'; false omits it.
crossOriginResourcePolicy?
Section titled “crossOriginResourcePolicy?”
readonlyoptionalcrossOriginResourcePolicy?:"same-origin"|"same-site"|"cross-origin"|false
Defined in: src/http/middleware/SecurityHeadersOptions.ts:42
Cross-Origin-Resource-Policy. Default 'same-origin'; false omits it.
frameOptions?
Section titled “frameOptions?”
readonlyoptionalframeOptions?:"DENY"|"SAMEORIGIN"|false
Defined in: src/http/middleware/SecurityHeadersOptions.ts:34
X-Frame-Options. Default 'DENY'; false omits it.
readonlyoptionalhsts?:Partial<HstsOptionsType> |false
Defined in: src/http/middleware/SecurityHeadersOptions.ts:48
Also emit HSTS with these options. Default false (opt-in — see strictTransportSecurity).
permissionsPolicy?
Section titled “permissionsPolicy?”
readonlyoptionalpermissionsPolicy?:Readonly<Record<string, readonlystring[]>> |false
Defined in: src/http/middleware/SecurityHeadersOptions.ts:38
Permissions-Policy as feature→allowlist. Default false (omitted).
referrerPolicy?
Section titled “referrerPolicy?”
readonlyoptionalreferrerPolicy?:string|false
Defined in: src/http/middleware/SecurityHeadersOptions.ts:36
Referrer-Policy. Default 'no-referrer'; false omits it.
xssProtection?
Section titled “xssProtection?”
readonlyoptionalxssProtection?:boolean
Defined in: src/http/middleware/SecurityHeadersOptions.ts:46
X-XSS-Protection: 0 (disable the buggy legacy filter). Default true.
