zongmingzhi opened a new pull request, #6350:
URL: https://github.com/apache/shenyu/pull/6350

   ### Description
   
   This PR prevents the HTTP client plugins from forwarding request bodies for 
GET and HEAD requests.
   
   Sending a body for GET or HEAD may cause Reactor Netty or WebClient to emit 
unexpected transfer encoding headers, which can break compatibility with some 
upstream servers.
   
   ### Changes
   
   - Add shared request-body eligibility logic in `AbstractHttpClientPlugin`.
   - Reuse the shared logic in `NettyHttpClientPlugin`.
   - Reuse the shared logic in `WebClientPlugin`.
   - Keep request body forwarding unchanged for non-GET/HEAD methods.
   
   ### Tests
   
   - [x] `./mvnw -pl shenyu-plugin/shenyu-plugin-httpclient -am -DskipTests 
validate`
   - [x] `./mvnw -pl shenyu-plugin/shenyu-plugin-httpclient -am test`
   
   ### Checklist
   
   - [x] I have read the [contribution 
guidelines](https://shenyu.apache.org/community/contributor-guide).
   - [ ] I submit test cases (unit or integration tests) that back your changes.
   - [x] My local test passed `./mvnw -pl 
shenyu-plugin/shenyu-plugin-httpclient -am test`.
   


-- 
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