cloudbase-ai opened a new pull request, #7902:
URL: https://github.com/apache/shenyu/pull/7902

   Fixes #7900.
   
   A paramMapping rule that adds `injected=yes` previously changed the 
unrelated form field `flag` into `flag=`. It now preserves `flag&injected=yes`, 
keeping a valueless field distinct from an empty-string field and retaining 
mixed repeated values in order.
   
   Use a cached standard Gson only for form-map deserialization. The shared 
GsonUtils String adapter intentionally normalizes JSON null to an empty string, 
which is inappropriate for this form representation. Leave the global adapter 
and existing serialization unchanged: null elements in form-value lists are 
already serialized as JSON null.
   
   Delete the duplicate manual URL encoding, String/byte-array construction and 
Content-Length calculation. Spring's existing FormHttpMessageWriter already 
serializes the actual form with its configured charset and supplies the correct 
byte length. The removed precomputation could not handle a preserved null 
value. No dependency or global serializer behavior changes.
   
   Validation on Java 17 with the Maven wrapper:
   
   - Before the fix, three of four new request-path cases failed: valueless 
field, mixed repeated values, and an encoded key without a value. The 
empty-string control passed.
   - All 14 FormDataOperator cases now pass, including null additions, 
encoded/unicode keys, reserved characters, UTF-8/ISO-8859-1/UTF-16LE, actual 
byte length, and existing addition/removal/rename/empty-form behavior.
   - Parameter-mapping and dependency reactor: **986 tests, 0 failures, 0 
errors, 5 skipped**. Checkstyle, Apache RAT and `git diff --check` pass. 
Independent review found no blocking issue.
   - Eight additional local HTTP forwarding cases ran a real client → 
FormDataOperator → echo backend. The baseline exhibited null-to-empty 
conversion; the fix preserved the expected valueless fields. Both runs verified 
exact upstream Content-Length against received bytes, including all three 
charsets, repeated values and null additions. This exercises the actual 
operator and Spring form codecs with local HTTP servers, rather than a full 
Bootstrap/configuration-sync deployment.
   
   ```sh
   ./mvnw -B -ntp -pl shenyu-plugin/shenyu-plugin-param-mapping -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 regression coverage 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]

Reply via email to