[
https://issues.apache.org/jira/browse/HTTPCLIENT-1089?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Oleg Kalnichevski resolved HTTPCLIENT-1089.
-------------------------------------------
Resolution: Invalid
This is per HTTP spec requirement
---
10.3.3 302 Found
...
If the 302 status code is received in response to a request other
than GET or HEAD, the user agent MUST NOT automatically redirect the
request unless it can be confirmed by the user, since this might
change the conditions under which the request was issued.
---
> HTTP Client does not handle 302 redirect in POST request
> --------------------------------------------------------
>
> Key: HTTPCLIENT-1089
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1089
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Components: HttpClient
> Affects Versions: 4.1.1
> Environment: *
> Reporter: Bartosz Firyn
> Labels: redirect
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> POST requests are not being automatically redirected after receiving 302
> response.
> This is because there is a statement in the DefaultRedirectStrategy class:
> 82: case HttpStatus.SC_MOVED_TEMPORARILY:
> 83: return (method.equalsIgnoreCase(HttpGet.METHOD_NAME)
> 84: || method.equalsIgnoreCase(HttpHead.METHOD_NAME)) &&
> locationHeader != null;
> Which means that only HEAD and GET requests are being redirected. In my
> opinion all requests should be redirected, not only these two types.
> This should be:
> 82: case HttpStatus.SC_MOVED_TEMPORARILY:
> 83: return locationHeader != null;
> After receiving 302 status for POST request new GET request should be send to
> Location URI. Internet browsers works in the same way.
> Best Regards
> Bartosz Firyn
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]