otavioprado opened a new pull request, #565:
URL: https://github.com/apache/httpcomponents-client/pull/565
This commit adds a new implementation of the LaxRedirectStrategy, bringing
back functionality similar to that found in HttpClient 4.x. The
LaxRedirectStrategy automatically redirects all HEAD, GET, POST, and DELETE
requests, relaxing the restrictions imposed by the HTTP specification on
automatic redirection of POST methods.
### Key Features:
- **Supported Methods**: Redirects HEAD, GET, POST, and DELETE methods.
- **Location Resolution**: Automatically resolves relative redirect URIs
against the request URI.
- **Compatibility**: Ensures compatibility with existing 4.x applications by
providing a familiar API and redirect behavior.
- **Normalization**: Normalizes and converts the host part of the redirect
URI to lowercase, maintaining consistent behavior.
### Benefits:
- Simplifies migration from HttpClient 4.x to 5.x by providing a drop-in
replacement for LaxRedirectStrategy.
- Supports applications that rely on flexible redirect behavior for
non-idempotent HTTP methods.
### Usage:
```java
CloseableHttpClient httpClient = HttpClients.custom()
.setRedirectStrategy(LaxRedirectStrategy.INSTANCE)
.build();
```
I have reopened this pull request based on the feedback provided by @ok2c.
Below are the changes made to address the comments:
#### Changed Target Branch:
- The target branch has been changed from the stable branch to the master
(5.4) branch, as new features should not be added to stable branches.
#### Updated since Tag:
- The since tag has been updated to 5.4 to reflect the correct version for
this feature.
#### Adjusted Test Method Visibility:
- Test methods now have package visibility to maintain consistency with
existing test cases.
Thank you for the feedback, and please let me know if there are any further
changes required!
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]