hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lars Bachmann (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1452) in case of a redirect a wrong host param is set to http header
Date Mon, 27 Jan 2014 10:40:37 GMT

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

Lars Bachmann commented on HTTPCLIENT-1452:
-------------------------------------------

Yes i do set the host param before the request. Without the host param its also working fine
for me. But why in case of setting the host param it is not working ? I dont understand.

> in case of a redirect a wrong host param is set to http header
> --------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1452
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1452
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.3.1
>            Reporter: Lars Bachmann
>         Attachments: wire.log
>
>
> The following url will lead to a circular redirect and a CircularRedirectException in
the end:
> http://it.bing.com/
> The reason is that http://it.bing.com will redirect to http://www.bing.com but the header
param "host" is not set to the new host (bing.com), instead the host param of the original
request (it.bing.com) is used. In the end the redirect request will not call http://www.bing.com
but http://it.bing.com instead, which is the same location like the original url and will
end up in a circular deadlock.
> The fix would be to override the host param with the value of the redirect request after
copying all header params from the original request to the redirect request.
> The class to adjust is: org.apache.http.impl.client.DefaultRequestDirector.java
> The problem is also addressed here:
> http://stackoverflow.com/questions/6698214/avoid-circular-redirect-using-httpclient-4-1-1



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

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


Mime
View raw message