Skip to content

Fix #372: Remove redundant manual CORS headers in app.py#373

Open
SriHarsha-23 wants to merge 1 commit intoEAPD-DRB:mainfrom
SriHarsha-23:feature/372-remove-manual-cors
Open

Fix #372: Remove redundant manual CORS headers in app.py#373
SriHarsha-23 wants to merge 1 commit intoEAPD-DRB:mainfrom
SriHarsha-23:feature/372-remove-manual-cors

Conversation

@SriHarsha-23
Copy link
Copy Markdown

@SriHarsha-23 SriHarsha-23 commented Mar 24, 2026

Linked issue

Existing related work reviewed

  • Issues/PRs reviewed:
  • If none found, write: None found after search

Overlap assessment

  • Classification: none
  • Overlapping items: N/A
  • Why this is not duplicate/superseded: N/A

Why this PR should proceed

  • Resolves a network security conflict caused by legacy technical debt.

Summary

  • What changed: Removed the legacy @app.after_request block in API/app.py that manually injected CORS headers.
  • Why: The application already utilizes the Flask-CORS middleware (CORS(app)). The manual hook was injecting duplicate Access-Control-Allow-Origin headers (violating W3C specs) and hardcoding an invalid portless localhost origin along with dead Heroku routes. Removing it allows Flask-CORS to handle cross-origin requests securely and dynamically.

Validation

  • Tests added/updated (or not applicable)
  • Validation steps documented
  • Evidence attached (logs/screenshots/output as relevant)

Validation steps: Verified that API/app.py compiles and the local Flask server runs successfully without the removed block, allowing Flask-CORS to handle headers normally.

Documentation

  • Docs updated in this PR (or not applicable)
  • Any setup/workflow changes reflected in repo docs

Scope check

  • No unrelated refactors
  • Implemented from a feature branch
  • Change is deliverable without upstream OSeMOSYS/MUIO dependency
  • Base repo/branch is EAPD-DRB/MUIOGO:main (not upstream)

Exception rationale

@github-actions github-actions bot added the needs-intake-fix PR intake structure needs maintainer follow-up label Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-intake-fix PR intake structure needs maintainer follow-up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Redundant manual CORS headers in app.py conflict with Flask-CORS and violate W3C spec

1 participant