Skip to content

[3/15] Emit baseline security headers on every response - #156

Open
UnknownJoe796 wants to merge 2 commits into
v53/core-request-handlingfrom
v53/security-headers
Open

[3/15] Emit baseline security headers on every response#156
UnknownJoe796 wants to merge 2 commits into
v53/core-request-handlingfrom
v53/security-headers

Conversation

@UnknownJoe796

Copy link
Copy Markdown
Contributor

Adds SecurityHeadersInterceptor, installed by default, emitting a baseline set
of security headers on every response. Stacked on the interceptor-chain fix so
error responses carry them too.

UnknownJoe796 and others added 2 commits July 29, 2026 17:02
Add SecurityHeadersInterceptor (core), installed by default as the
outermost interceptor at the single top-level composition point in
ServerDefinition. It adds X-Content-Type-Options: nosniff to all
responses and Strict-Transport-Security (max-age=3600, per
expectations.md) to https responses only, per the HSTS spec. Existing
headers set by a handler are left untouched so endpoints can override.

Closes the expectations.md security-header gap for all engines at once,
since it lives in shared request handling rather than per-engine code.
HSTS max-age is a constructor parameter; production deployments may
prefer a longer value.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit 4e43194)
(cherry picked from commit 798fb93)
Not every app wants these headers forced on; install it explicitly:

  init { install(SecurityHeadersInterceptor()) }

Also raises the default HSTS max-age to one year (the value browsers and
the HSTS preload list expect) -- a short max-age gives an attacker a wide
window to downgrade the connection, so it should only be lowered while a
deployment isn't yet confident in its https setup.

(cherry picked from commit d0355f1)
@UnknownJoe796
UnknownJoe796 force-pushed the v53/docs-architecture branch from 9244daf to 266118b Compare July 30, 2026 02:19
@UnknownJoe796
UnknownJoe796 force-pushed the v53/security-headers branch from d0355f1 to ee913c8 Compare July 30, 2026 02:19
@UnknownJoe796
UnknownJoe796 changed the base branch from v53/docs-architecture to v53/core-request-handling July 30, 2026 02:24
@iHoonter
iHoonter self-requested a review July 31, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants