[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-2333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17871080#comment-17871080
 ] 

ASF subversion and git services commented on HTTPCLIENT-2333:
-------------------------------------------------------------

Commit f898f1aca38f77f62a007856a674629cae5a02e6 in httpcomponents-client's 
branch refs/heads/5.3.x from Oleg Kalnichevski
[ https://gitbox.apache.org/repos/asf?p=httpcomponents-client.git;h=f898f1aca ]

HTTPCLIENT-2333: update execution scope upon request redirect in order to avoid 
re-execution of the original request in case of an i/o error


> A request retry upon redirect is incorrectly flagged as a circular redirect 
> ----------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-2333
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2333
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient (async), HttpClient (classic)
>    Affects Versions: 5.3.1
>            Reporter: Teresa Tang
>            Priority: Minor
>             Fix For: 5.3.2, 5.4-beta2
>
>         Attachments: NullHandler.java, TestRedirects.java
>
>
> When a request is redirected and then needs to be retried, the retry is 
> treated as a circular redirect. If circular redirects are not allowed, an 
> error is thrown:
>  
> {code:java}
> org.apache.hc.client5.http.ClientProtocolException: Circular redirect to 
> 'http://localhost:35731/random/50'    at 
> org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:173)
>     at 
> org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(CloseableHttpClient.java:245)
>     at 
> org.apache.hc.client5.testing.sync.TestRedirects.testRetryUponRedirect(TestRedirects.java:241)
>     at java.base/java.lang.reflect.Method.invoke(Method.java:580)
>     at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
>     at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
>     at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
> Caused by: org.apache.hc.client5.http.CircularRedirectException: Circular 
> redirect to 'http://localhost:35731/random/50'
>     at 
> org.apache.hc.client5.http.impl.classic.RedirectExec.execute(RedirectExec.java:144)
>     at 
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ExecChainElement.java:51)
>     at 
> org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(InternalHttpClient.java:170)
>     ... 6 more{code}
>  
> Please see testRetryUponRedirect in TestRedirects.java for an example. 
> NullHandler.java will return a bad response only for the first redirected 
> request (files attached)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to