hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikola Petrov (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HTTPCLIENT-1312) Decompressing on redirects with redirection support off doesn't work properly
Date Wed, 30 Jan 2013 15:09:13 GMT

     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Nikola Petrov updated HTTPCLIENT-1312:
--------------------------------------

    Description: 
We are a having a problem with the httpclient implementation on
redirecting websites that support gzip encoding. The problem occurs only
if the automatic redirect facilities are disabled. Here is a resulting code that fails - note
that if you set the HANDLE_REDIRECTS to true it works

{code:language:java}
        public static void main(String[] args) throws ClientProtocolException,
                        IOException {
                HttpParams httpParams = new BasicHttpParams();
                httpParams.setBooleanParameter(ClientPNames.HANDLE_REDIRECTS, Boolean.FALSE);
                HttpClient httpclient = new DecompressingHttpClient(new DefaultHttpClient(httpParams));

                ResponseHandler<Void> responseHandler = new ResponseHandler<Void>()
{

                        public Void handleResponse(HttpResponse response)
                                        throws ClientProtocolException, IOException {
                                response.getEntity().getContent();
                                return null;
                        }
                };
                httpclient.execute(new HttpGet(URI.create(PROBLEMATIC_URL)),
                                responseHandler);

        }
{code}

  was:
We are a having a problem with the httpclient implementation on
redirecting websites that support gzip encoding. The problem occurs only
if the automatic redirect facilities are disabled. Here is a resulting code that fails - note
that if you set the HANDLE_REDIRECTS to true it works


        public static void main(String[] args) throws ClientProtocolException,
                        IOException {
                HttpParams httpParams = new BasicHttpParams();
                httpParams.setBooleanParameter(ClientPNames.HANDLE_REDIRECTS, Boolean.FALSE);
                HttpClient httpclient = new DecompressingHttpClient(new DefaultHttpClient(httpParams));

                ResponseHandler<Void> responseHandler = new ResponseHandler<Void>()
{

                        public Void handleResponse(HttpResponse response)
                                        throws ClientProtocolException, IOException {
                                response.getEntity().getContent();
                                return null;
                        }
                };
                httpclient.execute(new HttpGet(URI.create(PROBLEMATIC_URL)),
                                responseHandler);

        }


    
> Decompressing on redirects with redirection support off doesn't work properly
> -----------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1312
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1312
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.2.2
>            Reporter: Nikola Petrov
>            Priority: Critical
>              Labels: gzip, redirect
>
> We are a having a problem with the httpclient implementation on
> redirecting websites that support gzip encoding. The problem occurs only
> if the automatic redirect facilities are disabled. Here is a resulting code that fails
- note that if you set the HANDLE_REDIRECTS to true it works
> {code:language:java}
>         public static void main(String[] args) throws ClientProtocolException,
>                         IOException {
>                 HttpParams httpParams = new BasicHttpParams();
>                 httpParams.setBooleanParameter(ClientPNames.HANDLE_REDIRECTS, Boolean.FALSE);
>                 HttpClient httpclient = new DecompressingHttpClient(new DefaultHttpClient(httpParams));
>                 ResponseHandler<Void> responseHandler = new ResponseHandler<Void>()
{
>                         public Void handleResponse(HttpResponse response)
>                                         throws ClientProtocolException, IOException {
>                                 response.getEntity().getContent();
>                                 return null;
>                         }
>                 };
>                 httpclient.execute(new HttpGet(URI.create(PROBLEMATIC_URL)),
>                                 responseHandler);
>         }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


Mime
View raw message