Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve CORS policy issue after header modification and re-routing #4

Open
wants to merge 1 commit into
base: envoy-1.27
Choose a base branch
from

Conversation

wilkinszhang
Copy link

Related issue: alibaba/higress#1769

Commit Message: fix(cors): re-evaluate CORS policy after header modification and rerouting
Additional Description: This fixes the scenario where CORS policy becomes ineffective after modifying headers and triggering re-routing. The root cause is that CORS filter's decodeHeader phase only executes on initial route match. When headers are modified mid-request (e.g. via header transformation plugin) leading to re-routing, the subsequent route's CORS configuration wasn't being applied.
Risk Level:
Testing: I wrote an integration test, but I don’t know how to test the route change scenario. I haven’t committed the test code yet.
Docs Changes: N/A (Behavioral fix with no API changes)
Release Notes: fix: Ensure CORS policies take effect when requests are re-routed after header modifications
Platform Specific Features: N/A
[Optional Runtime guard:]
[Optional Fixes #Issue] Fixes alibaba/higress#1769
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

@CLAassistant
Copy link

CLAassistant commented Feb 25, 2025

CLA assistant check
All committers have signed the CLA.

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.

After modifying the header and re-routing, the CORS policy fails to take effect.
2 participants