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

Michael Moser commented on NIFI-1714:
-------------------------------------

I didn't test against the URL in the HTTPCLIENT ticket.  When testing against 
my corporate web server that does this, the original GetHTTP code logs the 
cookie header warning then the ClientProtocolException is indeed a circular 
redirect error.  When I modified GetHTTP with the patch, both the cookie header 
warning and circular redirect error goes away.

This could be mistakes on the part of some custom web server code, using wrong 
date functions.  For example Jetty HTTP DateGenerator has format_date() and 
format_cookie_date() functions which are slightly different formats (space 
versus dash in dd MMM yy for default and dd-MMM-yy for cookie).

It's just unfortunate that HttpClient is so strict by default on the cookie 
expires date format.  RFC-6265 says both spaces and dashes are valid separators 
in the date format.

> GetHTTP fails to parse certain cookie expiration dates
> ------------------------------------------------------
>
>                 Key: NIFI-1714
>                 URL: https://issues.apache.org/jira/browse/NIFI-1714
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: 0.6.0
>            Reporter: Michael Moser
>            Assignee: Michael Moser
>             Fix For: 0.6.1
>
>         Attachments: NIFI-1714-withtests.patch, NIFI-1714.patch
>
>
> I'm trying to use GetHTTP to access a web server that assigns a _session 
> cookie then redirects to another URL that expects that cookie to be set.  
> Normally the Apache HTTPComponents HttpClient handles this.
> Unfortunately, due to a bug HTTPCLIENT-1640, the HttpClient fails to parse 
> this particular server's _session cookie expiration date.  The error is
> WARN o.a.h.c.p.ResponseProcessCookies Invalid Cookie Header: "Set-Cookie: 
> _session=abc123; path=/; expires=Wed, 06 Apr 2016 22:10:16 -0000". Invalid 
> 'expires' attribute: Wed, 06 Apr 2016 22:10:16 -000
> ERROR o.a.n.p.s.GetHTTP Failed to retrieve file from http://fqdn/url due to 
> null; rolling back session: org.apache.http.client.ClientProtocolException



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to