[ https://issues.apache.org/jira/browse/CXF-2462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12838034#action_12838034 ]
Arnaud Lucas commented on CXF-2462: ----------------------------------- Hi Sergey, We are now using CXF 2.2.6. The client provides some custom HTTP headers like x-im-my-header: "My API" (notice the double quotes around My API_ However, the web service POJO is getting injected for @HeaderParam("x-im-my-header") with the value My instead of My API or instead of "My API" like it used to. I see in HttpHeadersImpl.getHeaderValues(...) that if a value has quotes, it gets parsed using the complex header expression. I am not sure that the value should be parsed at all when quoted at least for custom headers. It may be better if CXF just removes the quotes around the value and unescape any quote characters within the value at least for custom headers. Feel free to contact me by email to get more information: arnaud.lu...@ironmountain.com > CXF REST is not parsing the header value correctly if a comma is specified in > a parameter value. > ------------------------------------------------------------------------------------------------ > > Key: CXF-2462 > URL: https://issues.apache.org/jira/browse/CXF-2462 > Project: CXF > Issue Type: Bug > Affects Versions: 2.2.3 > Environment: Ubuntu 9.04, Compaq 6910p, 4GB memory > Reporter: Jerry Chabot > Assignee: Sergey Beryozkin > Fix For: 2.2.5, 2.3 > > > The RFC2616 and RFC822 states that a header is comprised of the following: > header = [ header-value ] *( "," [ header-value ] ) > header-value = name [ "=" [ value ] ] *( ";" [ param ] ) > param = name [ "=" [ value ] ] > name = token > value = token | quoted-string > token = 1*<any CHAR except CTLs or separators> > separators = "(" | ")" | "<" | ">" | "@" > | "," | ";" | ":" | "\" | <"> > | "/" | "[" | "]" | "?" | "=" > | "{" | "}" | SP | HT > quoted-string = ( <"> *(qdtext | quoted-pair ) <"> ) > qdtext = <any TEXT except <">> > The backslash character ("\") MAY be used as a single-character > quoting mechanism only within quoted-string and comment constructs. > quoted-pair = "\" CHAR > Based on the above, this header should be valid > xm-my-header : foo,bar,dogs="snoopy,bowzer";cat=garfield > My REST service defines the method parameter this in its interface as > @HeaderParam("xm-my-header") List<String> args > I expected CXF to pass 3 elements into the service: > [0] foo > [1] bar > [2] dogs="snoopy,bowzer"; cat=garfield > But, this is what CXF passes into the service: > [0] foo > [1] bar > [2] dogs="snoopy > [3] bowzer";cat=garfield > CFX is parsing the header value using the comma as a delimiter. But, it is > ignoring the fact that the value may be within a quoted-string. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.