fix: resolve CORS policy issue after header modification and re-routing#4
Draft
wilkinszhang wants to merge 1 commit intohigress-group:envoy-1.27from
Draft
fix: resolve CORS policy issue after header modification and re-routing#4wilkinszhang wants to merge 1 commit intohigress-group:envoy-1.27from
wilkinszhang wants to merge 1 commit intohigress-group:envoy-1.27from
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:]