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

Paul Lindner commented on SHINDIG-1562:
---------------------------------------

This solution looks dangerous.  I believe that the FETCHER (and the associated 
cookie store) is globally shared for all http requests.  Perhaps gadget spec 
fetching could use a separate fetcher instance per request with a proper cookie 
jar.


> Shindig does not store cookies between redirects
> ------------------------------------------------
>
>                 Key: SHINDIG-1562
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-1562
>             Project: Shindig
>          Issue Type: Bug
>          Components: Java
>    Affects Versions: 2.0.0
>            Reporter: Pavel Feldman
>
> This problem is caused by this fix 
> https://issues.apache.org/jira/browse/SHINDIG-1382
> We store gadget xml files on a web server that has not-so-standard but valid 
> behavior. If request comes without certain cookie, web server redirects it to 
> the same url through 302 Moved Temporarily and sets a cookie. Normally, 
> redirected client will store a cookie and perform second request with it, so 
> web server will see a cookie and return expected xml. Because of SHINDIG-1382 
> cookies are not stored, so next request goes to the same url without a cookie 
> and web server redirects it to the same url again. This produces 
> ClientProtocolException caused by 
> org.apache.http.client.CircularRedirectException: Circular redirect to '...' 
> at DefaultRedirectHandler.java:173
> The fix we implemented locally is to remove following lines
>     client.removeRequestInterceptorByClass(RequestAddCookies.class); 
>     client.removeResponseInterceptorByClass(ResponseProcessCookies.class);
> from BasicHttpFetcher.java and clear cookies
>       response = FETCHER.execute(host, httpMethod);
>       +((AbstractHttpClient)FETCHER).getCookieStore().clear();
> after performing request, so cookies do not get stored unlimited.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to