Skip to content

feat: add security headers middleware#1037

Open
deepsikha-dash wants to merge 1 commit into
imDarshanGK:mainfrom
deepsikha-dash:issue-633-secure-headers
Open

feat: add security headers middleware#1037
deepsikha-dash wants to merge 1 commit into
imDarshanGK:mainfrom
deepsikha-dash:issue-633-secure-headers

Conversation

@deepsikha-dash

Copy link
Copy Markdown

Description

Added a middleware to inject security-related HTTP headers into responses.

  • Adds Strict-Transport-Security header for HTTPS requests.
  • Adds X-Frame-Options: DENY header to mitigate clickjacking attacks.
  • Improves the default security posture of the backend.

Related Issue

Fixes #633

Type of change

  • Bug fix
  • New feature / enhancement
  • Documentation update
  • Test addition
  • Refactor

Checklist

  • I have read CONTRIBUTING.md
  • My branch is up to date with main
  • I have run pytest -v and all tests pass
  • I have not introduced duplicate issues or features
  • My PR title follows the format: feat/fix/docs/test: short description
  • I have added tests for new features (Level 2 and 3 issues)
  • No hardcoded secrets or API keys in my code
  • This PR is linked to a GSSoC 2026 issue

Screenshots (if frontend change)

N/A

Test evidence

python -m compileall backend

Output:

Listing 'backend'...
Listing 'backend\\app'...
Compiling 'backend\\app\\main.py'...
Listing 'backend\\app\\routers'...
Listing 'backend\\app\\services'...
Listing 'backend\\app\\utils'...
Listing 'backend\\tests'...
Listing 'backend\\tests\\fixtures'...

@github-actions

Copy link
Copy Markdown

👋 This PR has had no activity for 7 days.

Please push updates or comment if you still need more time.

Inactive PRs may be closed automatically after 7 more days.

@github-actions github-actions Bot added the stale label Jun 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add secure headers (HSTS, X-Frame-Options) in responses

1 participant