Fix #3729: Support optional parameters in RewriteLocationResponseHeader filter#3886
Open
belljun3395 wants to merge 1 commit intospring-cloud:mainfrom
Open
Fix #3729: Support optional parameters in RewriteLocationResponseHeader filter#3886belljun3395 wants to merge 1 commit intospring-cloud:mainfrom
belljun3395 wants to merge 1 commit intospring-cloud:mainfrom
Conversation
…onseHeader filter - Add 1, 2, 3 parameter overloads in FilterFunctions and AfterFilterFunctions - Support flexible YAML configuration: RewriteLocationResponseHeader=AS_IN_REQUEST - Add comprehensive tests for all parameter combinations - Update documentation with multiple configuration examples - Maintain full backward compatibility with existing 4-parameter method Resolves spring-cloud#3729 Signed-off-by: JongJun Kim <195850@jnu.ac.kr>
d1033b5 to
ccd5542
Compare
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.
Fix #3729: Support optional parameters in RewriteLocationResponseHeader filter
Summary
This PR resolves issue #3729 by adding overloaded methods for the
RewriteLocationResponseHeaderfilter, enabling flexible YAML configuration with optional parameters.Problem
Users were unable to use the
RewriteLocationResponseHeaderfilter in YAML configuration with optional parameters. The filter only supported the full 4-parameter signature, causing failures when users tried to use shorter forms:Error:
Solution
Added method overloads to support 1, 2, 3, and 4 parameters in both
FilterFunctionsandAfterFilterFunctions:Changes Made
Code Changes
@ShortcutannotationYAML Configuration Support
Now supports all these configurations:
Testing
New Tests Added
rewriteLocationResponseHeaderWithMinimalArgsWorks()- Tests 1 parameterrewriteLocationResponseHeaderWithTwoArgsWorks()- Tests 2 parametersrewriteLocationResponseHeaderWithThreeArgsWorks()- Tests 3 parametersTest Results
Verification
All tests verify the
Locationheader is correctly rewritten:Locationheader and request HostBackward Compatibility
✅ 100% backward compatible
Documentation Updates
Updated the AsciiDoc documentation to include:
Code Quality
Related Issue
Resolves #3729
Checklist