[3/15] Emit baseline security headers on every response - #156
Open
UnknownJoe796 wants to merge 2 commits into
Open
[3/15] Emit baseline security headers on every response#156UnknownJoe796 wants to merge 2 commits into
UnknownJoe796 wants to merge 2 commits into
Conversation
UnknownJoe796
commented
Jul 29, 2026
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
force-pushed
the
v53/docs-architecture
branch
from
July 30, 2026 02:19
9244daf to
266118b
Compare
UnknownJoe796
force-pushed
the
v53/security-headers
branch
from
July 30, 2026 02:19
d0355f1 to
ee913c8
Compare
UnknownJoe796
changed the base branch from
v53/docs-architecture
to
v53/core-request-handling
July 30, 2026 02:24
iHoonter
self-requested a review
July 31, 2026 22:34
iHoonter
approved these changes
Jul 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
SecurityHeadersInterceptor, installed by default, emitting a baseline setof security headers on every response. Stacked on the interceptor-chain fix so
error responses carry them too.