cloudbase-ai opened a new pull request, #7905:
URL: https://github.com/apache/shenyu/pull/7905
Fixes #7904.
Request plugin key replacements could delete data when source and
destination named the same entry. `token -> token` removed every query value;
`X-Id -> X-Id` and the case-only header rename `X-Id -> x-id` removed the
header entirely. Both methods appended values and then removed the source,
which was also the destination.
Skip exact identity replacements so query values and ordering stay intact.
For a header rename, remove the source before adding its values to the
destination, allowing case-only names to work with case-insensitive
HttpHeaders. Ordinary renames retain the existing destination-values-first
merge order; query names remain case-sensitive. Cookie behavior and rule schema
are unchanged.
Validation on Java 17 with the Maven wrapper:
- All five initial regressions failed on unmodified master: two query cases
(including repeated valueless/empty values) and three exact/case-only header
cases.
- Added controls cover existing-target merging/order, case-sensitive query
names, missing sources, original request preservation and an encoded
`/files/a%2Fb` path. All 24 RequestPlugin cases pass.
- Request-plugin dependency reactor: **991 tests, 0 failures, 0 errors, 5
skipped**. Checkstyle, Apache RAT and `git diff --check` pass. Independent
review found no blocking issue.
- Ten additional raw HTTP captures run the actual RequestPlugin, production
request-URI builder and both NettyHttpClientPlugin/WebClientPlugin against a
local socket receiver. On the baseline, both clients sent no `X-Id` values for
exact/case-only header rules and omitted `token` for its identity rule. The
fixed version transmitted all original values and query order. Ordinary header
merging and case-sensitive query merging were identical before/after; the
encoded path stayed intact. This is a focused forwarding harness, not the full
Bootstrap/configuration-sync Docker matrix.
```sh
./mvnw -B -ntp -pl shenyu-plugin/shenyu-plugin-request -am \
test apache-rat:check -DskipRemoteResources=true \
-Djacoco.skip=true -Dmaven.javadoc.skip=true
```
- [x] Follow the contribution guidelines and DCO sign-off.
- [x] Add regressions and verify the affected reactor above.
- [ ] Full-repository clean install (the affected reactor was verified).
--
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]