gnodet opened a new pull request, #2952:
URL: https://github.com/apache/cxf/pull/2952
## Summary
- Adds `http.redirect.force.GET` property to `HTTPConduit` that changes the
request method from POST to GET on 301 (Moved Permanently) and 302 (Found)
redirects
- Per RFC 7231 Sections 6.4.2/6.4.3, user agents have historically changed
POST to GET on these redirects. This property enables that behavior when set to
`true`
- Minimal change: sets `Message.HTTP_REQUEST_METHOD` on the outMessage
before `retransmit()`, which naturally flows through `setupConnection()` and
skips body output for GET
## Usage
```java
WebClient wc = WebClient.create(address);
WebClient.getConfig(wc).getRequestContext().put("http.redirect.force.GET",
"true");
WebClient.getConfig(wc).getHttpConduit().getClient().setAutoRedirect(true);
```
Or via Spring/Blueprint configuration:
```xml
<http-conf:conduit name="*.http-conduit">
<http-conf:client AutoRedirect="true"/>
</http-conf:conduit>
```
With the context property `http.redirect.force.GET` set to `true`.
## Context
Supersedes #977 with a cleaner, non-API-breaking approach. The original PR
threaded a `boolean forceGET` parameter through abstract method signatures
across multiple transport implementations (URLConnection, HC5, Netty), which
was overly invasive. This implementation requires changes only in
`HTTPConduit.java` and follows the same pattern as existing `http.redirect.*`
properties.
## Test plan
- [x] Existing `HTTPConduitURLEasyMockTest` redirect tests pass
- [ ] CI verification
🤖 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]