hanzhe-one opened a new pull request, #7779:
URL: https://github.com/apache/shenyu/pull/7779

   ### What is the purpose of the change
   Fixes #7685.
   
   The request plugin rebuilt the URI whenever any transformation was 
configured and called `build().encode()` on a builder parsed from the 
already-encoded request URI. Percent escapes in the path were encoded a second 
time (`/files/a%2Fb` became `/files/a%252Fb`), even for rules that only changed 
headers or cookies. Downstream matching could then stop matching the original 
raw path.
   
   ### Brief changelog
   - Only rebuild the request URI when the rule changes query parameters; 
header and cookie-only rules keep the original URI untouched.
   - When a rebuild is required, encode query names/values exactly once and 
build the URI with `build(true)` so already-encoded path components are 
preserved.
   - Add regression tests for header-only and query-mutating rules with `%2F` / 
`%20` in the path.
   
   ### Verifying this change
   - `./mvnw test -pl shenyu-plugin/shenyu-plugin-request` (9 tests, all pass; 
includes the two new regression tests)
   - `./mvnw checkstyle:check -pl shenyu-plugin/shenyu-plugin-request` (0 
violations)
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to