Skip to content

Add HSTS for HTTPS production responses only - #272

Merged
drumpat01 merged 2 commits into
mainfrom
cursor/hsts-https-production-4d80
Oct 12, 2026
Merged

drumpat01 merged 2 commits into
mainfrom
cursor/hsts-https-production-4d80

Conversation

@drumpat01

@drumpat01 drumpat01 commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Lighthouse on journeydeck.me (Oct 12) reported a missing Strict-Transport-Security header.

This PR sends Strict-Transport-Security: max-age=31536000 only when all of these are true:

  • DRIVEOS_MODE=web (hosted production front door)
  • DRIVEOS_NODE_PUBLIC_ORIGIN is https:
  • the request is HTTPS (req.protocol or the first X-Forwarded-Proto value)

The header does not include includeSubDomains or preload. Desktop, HTTP, and non-https public origins stay unchanged. The Content-Security-Policy string is not modified.

Browser note

Browsers that see this header will remember HTTPS-only for journeydeck.me for one year (31,536,000 seconds). A mistaken deploy is sticky: HTTP visitors can be blocked from the site until the max-age expires or they clear site data. That is why this PR keeps HSTS off HTTP, off desktop, and off includeSubDomains / preload.

Tests

server/tests/hsts.test.ts covers HTTPS production (header present and exact), HTTP production (absent), desktop HTTPS (absent), and web mode with an http: public origin (absent). CSP default-src 'self' remains on the HTTPS production response.

JourneyDeck CI / validate is green. No visual change, so no screenshots. Do not merge or deploy from this PR.

Open in Web Open in Cursor 

cursoragent and others added 2 commits October 12, 2026 14:28
Add Strict-Transport-Security: max-age=31536000 on hosted web responses that arrive over HTTPS. Omit includeSubDomains and preload. Desktop and HTTP remain unchanged, and the Content-Security-Policy is not modified.

Co-authored-by: Patrick <[email protected]>
@drumpat01
drumpat01 marked this pull request as ready for review October 12, 2026 17:30
@drumpat01
drumpat01 merged commit 524ab7c into main Oct 12, 2026
1 check passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T17:33:55.449445Z 9eb48b6 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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