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 Thu, 12 Feb 2009 23:22:29 GMT
Larry Homes wrote:
> Ok that is simple enough.
> 

Larry

Set 'http.protocol.allow-circular-redirects' at the HttpClient level. 
Sorry, I should have spotted the mistake in one of your previous messages.

Oleg

> On Thu, Feb 12, 2009 at 2:21 PM, Oleg Kalnichevski <olegk@apache.org 
> <mailto:olegk@apache.org>> wrote:
> 
>     Larry Homes wrote:
> 
>         I read this site:
>         http://hc.apache.org/httpclient-3.x/logging.html
> 
>         and added the lines
>         System.setProperty("org.apache.commons.logging.Log",
>         "org.apache.commons.logging.impl.SimpleLog");
>         System.setProperty("org.apache.commons.logging.simplelog.showdatetime",
>         "true");
>         System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire",
>         "debug");
>         System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient",
>         "debug");
> 
>         but I am not sure how to go about retreiving the logs or where
>         they are.
>         This is in a servlet so I checked catalina.out since that is
>         where the error
>         stream leads, but there is nothing extra in there.
> 
>         Your patience is appreciated
> 
> 
>     Larry,
> 
>     Please try to reproduce the issue using a small standalone
>     application that can be run outside the servlet container. Then,
>     pass the following settings to the JVM process on startup to get log
>     entries written to the stdout:
> 
>     -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
>     -Dorg.apache.commons.logging.simplelog.log.httpclient.wire=DEBUG
>     -Dorg.apache.commons.logging.simplelog.log.org.apache.commons.httpclient=DEBUG
> 
> 
>     Oleg
> 
> 
>         On Wed, Feb 11, 2009 at 6:00 PM, Oleg Kalnichevski
>         <olegk@apache.org <mailto:olegk@apache.org>> wrote:
> 
>             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
>                 <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 <mailto: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
>                         <http://portal.acm.org> website, specifcally the
>                         results
>                         page with the url like:
> 
>                         http://portal.acm.org/results.cfm?coll=Portal&query=SomeCRazyString
>                         <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
>                         <http://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
>                         <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
>                         <mailto: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
>                             <mailto:httpclient-users-unsubscribe@hc.apache.org>
>                             For additional commands, e-mail:
>                             httpclient-users-help@hc.apache.org
>                             <mailto:httpclient-users-help@hc.apache.org>
> 
> 
> 
>                              ---------------------------------------------------------------------
> 
>                     To unsubscribe, e-mail:
>                     httpclient-users-unsubscribe@hc.apache.org
>                     <mailto:httpclient-users-unsubscribe@hc.apache.org>
>                     For additional commands, e-mail:
>                     httpclient-users-help@hc.apache.org
>                     <mailto:httpclient-users-help@hc.apache.org>
> 
> 
> 
>             ---------------------------------------------------------------------
>             To unsubscribe, e-mail:
>             httpclient-users-unsubscribe@hc.apache.org
>             <mailto:httpclient-users-unsubscribe@hc.apache.org>
>             For additional commands, e-mail:
>             httpclient-users-help@hc.apache.org
>             <mailto:httpclient-users-help@hc.apache.org>
> 
> 
> 
> 
> 
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>     <mailto:httpclient-users-unsubscribe@hc.apache.org>
>     For additional commands, e-mail: httpclient-users-help@hc.apache.org
>     <mailto: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