Repository navigation
Conversation
Lambda mode's static responses sent "max-age=31536000; includeSubDomains" while HTTP mode sent the same value plus "; preload". API responses and the health endpoint also lacked it. Move the value into one exported constant, api.HSTSHeaderValue, used by all four paths, and add a test that pins the Lambda, HTTP-mode and health headers to it. "preload" only makes the domain eligible for the browser preload list; submission to hstspreload.org remains a separate manual step. Closes LeanerCloud#14 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
Contributor
|
Autofix could not be updated. Open Coding to check access and billing. |
cristim
approved these changes
Oct 24, 2026
This branch has not been deployed
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.
What
Lambda mode's HSTS header dropped
preload, while HTTP mode sends it (#14). API responses (internal/api/handler.go) and the container health endpoint (internal/server/health.go) lacked it as well.The value now lives in one exported constant,
api.HSTSHeaderValue(max-age=31536000; includeSubDomains; preload). All four response paths use it:That way the modes can't drift apart again.
preloadonly makes the domain eligible for the browser preload list. Nothing is submitted. Submitting to hstspreload.org stays a separate manual step, and so does the decision to do it.Closes #14
Testing
On a14dc8f (main):
go build ./...passes.go vetpasses with and without-tags integrationoninternal/serverandinternal/api.go test -race -count=1 ./internal/server/ ./internal/api/passes.TestSecurityHeaders_HSTSMatchesAcrossModespins the Lambda, HTTP-mode and health headers to the constant and asserts it containspreload.handler_security_test.gonow expectpreload.gocyclo -over 10is clean on the changed files.scripts/test-git-secrets-allowlist.shgives 137 PASS. A git-secrets scan of the changed files in an isolated repo is clean, and the planted key was flagged.🤖 Generated with Claude Code