[
https://issues.apache.org/jira/browse/HTTPCORE-121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12534502
]
Andrea Selva commented on HTTPCORE-121:
---------------------------------------
Hi,
this is the my new findNext:
8<----------------------------------------------------------------------------------------------
protected HeaderElement findNext() {
HeaderElement tmpHeader;
HeaderElement tmpHeaderFix;
if (this.currentElementIdx == this.currentElements.length) {
if (!this.headerIt.hasNext()) {
return null;
}
this.currentElements = this.headerIt.nextHeader().getElements();
this.currentElementIdx = 0;
}
tmpHeader = this.currentElements[this.currentElementIdx++];
tmpHeaderFix = new BasicHeaderElement(this.headerName,
tmpHeader.getName());
return tmpHeaderFix;
}
8<----------------------------------------------------------------------------------------------
but i get some problems with the getElements() due to (i'suppose) a bad
parsing in the BasicHeaderValueParser.parseElements(). Because, when on a
Header i call getElements, it returns to me an array of HeaderElements where
the name field contains the parsed value, and the value field is empty. I do a
little patch as you cna see int he previous code snip, creating a swapped
BasicHeaderElement, but on cookie header "Set-Cookie: cookie1=1, cookie2=2" i
get not the two strings "cookie1=1" and "cookie2=2" but "cookie1" "1" ecc.
Is an error in the parser, or (probably) i do a wrong use of the api?
Thanks for the attention
Andrea
> new interface HeaderElementIterator
> -----------------------------------
>
> Key: HTTPCORE-121
> URL: https://issues.apache.org/jira/browse/HTTPCORE-121
> Project: HttpComponents Core
> Issue Type: Sub-task
> Components: HttpCore
> Affects Versions: 4.0-alpha5
> Reporter: Roland Weber
> Priority: Minor
> Fix For: 4.0-beta1
>
> Attachments: firstimpl.patch, firstimpl.patch
>
>
> As discussed for HTTPCORE-112, an interface and implementation for iterating
> over header elements would be useful.
> The implementation can be put on top of the HeaderIterator introduced with
> HTTPCORE-120.
--
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]