Skip to content

Security: Enforce HTTPS and HSTS Headers#116

Merged
Smartdevs17 merged 4 commits intoSmartdevs17:mainfrom
Cyberking99:fix/security-https-enforcement
Mar 24, 2026
Merged

Security: Enforce HTTPS and HSTS Headers#116
Smartdevs17 merged 4 commits intoSmartdevs17:mainfrom
Cyberking99:fix/security-https-enforcement

Conversation

@Cyberking99
Copy link
Copy Markdown
Contributor

This PR addresses security issue #7 by enforcing HTTPS and HSTS (HTTP Strict Transport Security) headers in the API server.

Changes:

  • Helmet HSTS: Configured helmet.hsts with maxAge: 31536000 and includeSubDomains: true to ensure browsers only communicate with the API over HTTPS.
  • HTTPS Enforcement: Added middleware to redirect HTTP requests to HTTPS when running in production (NODE_ENV=production), supporting common proxy headers (x-forwarded-proto).
  • Documentation: Updated docs/deployment.md with instructions for production security.
  • Testing: Added tests verifying the headers.

Fixes #7

docs(security): document https requirement for production

test(security): add tests for hsts and https redirection

Fixes Smartdevs17#7
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 24, 2026

@Cyberking99 is attempting to deploy a commit to the smartdevs17's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 24, 2026

@Cyberking99 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Cyberking99
Copy link
Copy Markdown
Contributor Author

@Smartdevs17 kindly review

@Smartdevs17 Smartdevs17 merged commit 5896648 into Smartdevs17:main Mar 24, 2026
4 of 7 checks passed
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.

Security: Missing HTTPS enforcement in API server configuration

2 participants