Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
3.1 (end of life)
-
commons-httpclient 3.1
Description
I'm using commons-httpclient-3.1.
I invoked a login request by PostMethod and get a success response. Here is the Set-Cookie header:
Set-Cookie: JSESSIONID=7798b313-6892-4c45-ac8e-8ccb6f390472; Path=/nexus; HttpOnly
I tried to parse it:
HeaderElement[] elems = HeaderElement.parseElements(header.getValue());
System.out.println(header+"--->"+elems.length);
It would only got the first element JSESSIONID, and others such as Path is missing.
I trace it and found such codes in HeaderElement.parseElements:
if (ch == '"')
{ qouted = !qouted; } HeaderElement element = null;
if ((!qouted) && (ch == ','))
else if (i == len - 1)
{ element = new HeaderElement(headerValue, from, len); }Is this a bug 'coz org.apache.commons.httpclient.Header.getValue just return a header string without quotes and ',' ?