hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Charles Fr Rey (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (HTTPCLIENT-852) CircularRedirectException encountered when using a proxy, but not when reaching the target directly
Date Thu, 28 May 2009 21:03:45 GMT

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

Charles Fr Rey edited comment on HTTPCLIENT-852 at 5/28/09 2:01 PM:
--------------------------------------------------------------------

Here are the logs. (Didn't see the possibility to attach files at first). I've only edited
the logs to hide my real proxy host.

      was (Author: sp1tf1r3):
    Here are the logs. (Didn't see the possibility to attach files at first).
  
> CircularRedirectException encountered when using a proxy, but not when reaching the target
directly
> ---------------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-852
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-852
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient, HttpConn
>    Affects Versions: 4.0 Beta 2
>         Environment: Proxy: tinyproxy/1.6.4
>            Reporter: Charles Fr Rey
>             Fix For: 4.0 Beta 3
>
>         Attachments: withoutproxy.log, withproxy.log, withproxyALLOW_CIRC_RED.log
>
>
> A CircularRedirectException is encountered when using a proxy (tinyproxy on a remote
machine), whereas everything is fine when using no proxy. The target is a URL such as http://www.seoconsultants.com/w3c/status-codes/301.asp
which has a 301 redirection.
> The issue can be fixed by using ALLOW_CIRCULAR_REDIRECTS set to true (client params),
but I can't consider this a "real" fix.
> Here is a snippet of code that exemplifies the problem (use your own proxy):
> ---
> String proxyHost = "xyz.webfactional.com";
> int proxyPort = 7295;
> DefaultHttpClient httpclient = new DefaultHttpClient();
> // without a proxy it's OK!
> httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY,
>         new HttpHost(proxyHost, proxyPort, "http"));
> HttpParams params = httpclient.getParams();
> HttpClientParams.setRedirecting(params, true);
> HttpProtocolParams.setUserAgent(params,
>         "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.10) Gecko/2009042315
Firefox/3.0.10");
> // OK, this fixes the problem, but at what cost / other problems ?
> //httpclient.getParams().setParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, true);
> String url = "http://www.seoconsultants.com/w3c/status-codes/301.asp";
> HttpUriRequest request;
> HttpResponse response;
> request = new HttpGet(url);
> System.out.println("request = " + request.getRequestLine());
> response = httpclient.execute(request);
> System.out.println("status = " + response.getStatusLine());
> System.out.println("headers = " + Arrays.asList(response.getAllHeaders()));
> ---

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message