Details
Description
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.