hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Disable Circular Redirect Detection
Date Wed, 11 Feb 2009 23:00:30 GMT
Larry Homes wrote:
> Ahh you are right. I read your previous email too quickly. However,
> correcting that mistake does not solve the problem.
> 
> From here:
> http://hc.apache.org/httpclient-3.x/preference-api.html
> 
> I saw another way to set the Params so here is the code I use currently.
> 
> GetMethod method = new GetMethod(
> http://portal.acm.org/results.cfm?coll=Portal&query=SomeCRazyString);
> method.getParams().setParameter("http.protocol.allow-circular-redirects",
> true);
> 
> and it still throws the exception
> 
> 

Post context / wire log

Oleg

> 
> On Wed, Feb 11, 2009 at 5:07 PM, Oleg Kalnichevski <olegk@apache.org> wrote:
> 
>> Larry Homes wrote:
>>
>>> Hmm I think I did it right, but it still doesn't work correctly.
>>>
>>> Let me provide a little more info:
>>>
>>> I am trying to go to the portal.acm.org website, specifcally the results
>>> page with the url like:
>>>
>>> http://portal.acm.org/results.cfm?coll=Portal&query=SomeCRazyString
>>>
>>> SomeCrazyString signifies a search term which results in no hits on acm's
>>> website. What portal.acm.org does in this case is redirect to itself with
>>> new parameters. I think httpclient see's this redirect to itself as a
>>> circular redirect, even though it just does it once.
>>>
>>> Here is how I tried to disable it:
>>>
>>> HttpClientParams http = new HttpClientParams();
>>> http.setBooleanParameter("ALLOW_CIRCULAR_REDIRECTS", true);
>>>
>> ALLOW_CIRCULAR_REDIRECTS != http.protocol.allow-circular-redirects
>>
>> Oleg
>>
>>
>>
>>  GetMethod method = new GetMethod("
>>> http://portal.acm.org/results.cfm?coll=Portal&query=SomeCRazyString");
>>> method.setParams(http);
>>>
>>> But I still get the CircularRedirectException.
>>>
>>> Any help is appreciated.
>>>
>>> On Wed, Feb 11, 2009 at 11:55 AM, Oleg Kalnichevski <olegk@apache.org
>>>> wrote:
>>>  Larry Homes wrote:
>>>>  Hello,
>>>>> Apache Httpclient is throwing a CircularRedirectException. I know the
>>>>> redirect is in fact not a circular redirect. Setting setFollowRedirects
>>>>> to
>>>>> false, solves the problem, but breaks some other sites redirect and,
in
>>>>> general, I'd like to keep redirects active. So is there any way to turn
>>>>> off
>>>>> just Circular Redirect detection? I read that I might be able to do so
>>>>> with
>>>>> HttpParams.setParams(), but I do not know what name to set to false to
>>>>> disable catching circular redirects.
>>>>>
>>>>> Thanks for any help
>>>>>
>>>>>
>>>>>  Set 'http.protocol.allow-circular-redirects' parameter to true.
>>>> Oleg
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>>>> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>>>>
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>>
>>
> 


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


Mime
View raw message