Skip to content

Added some tests. - #89

Merged
susrisha merged 1 commit into
developfrom
hotfix-4266
Aug 27, 2026
Merged

Added some tests.#89
susrisha merged 1 commit into
developfrom
hotfix-4266

Conversation

@susrisha

Copy link
Copy Markdown
Collaborator

This pull request improves how response headers are handled when proxying API requests, specifically to prevent CORS errors caused by duplicate or conflicting headers. The main change is to strip certain CORS-related headers from upstream responses before forwarding them, ensuring compatibility with the application's own CORS middleware. A new test is also added to verify this behavior.

Response header handling improvements:

  • Introduced a new STRIP_RESPONSE_HEADERS set in api/main.py to include CORS-related headers (such as access-control-allow-origin and vary) in addition to hop-by-hop headers, preventing them from being forwarded from upstream responses.
  • Updated header forwarding logic in both the capabilities and catch_all endpoints in api/main.py to use STRIP_RESPONSE_HEADERS instead of just HOP_BY_HOP_HEADERS, ensuring that problematic headers are stripped. [1] [2]

Testing improvements:

  • Added a new integration test test_upstream_cors_headers_are_stripped in tests/integration/test_proxy.py to verify that CORS-related headers from upstream (such as access-control-allow-origin and vary) are correctly removed from responses.

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9bb61832-ecfb-4913-8b6e-fef0c5f126d8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@susrisha
susrisha merged commit 16305f1 into develop Aug 27, 2026
2 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.

2 participants