Subject: Comma-separated values

From: eubpepe <[email-masked]>
Date: Fri, 23 Apr 1999 11:37:40 +0200

Is the following interpretation of how to look for comma-separated
values in header fields OK?

1. if a header value is allowed to be a comma seprated list of values --
like Contact, Via and Warning -- you should look for commas not within
quoted strings and interpret the tokens in between as seprate values

2. If you use a comma in such a field for other purposes than to seprate
header values it must be within a quoted string (are there other ways?).
Example is the comma in a SIP-Date in the expires parameter in a Contact
value which must be within a quoted string containing the SIP-Date.

3. For a header value not allowed to consist of a comma separated list,
a comma can be used in the header value outside a quoted string. Example
is the Date header where the comma is naked.

Wouldn't it be simpler not to allow naked commas? Where are commas used
in headers besides as separating values and in the SIP-Date?

Peter Peldan, PhD
Ellemtel Utvecklings AB
[email-masked]

---

From: Jonathan Rosenberg <[email-masked]>
Date: Fri, 23 Apr 1999 09:46:56 -0400

> quoted strings and interpret the tokens in between as seprate values

also, watch out for commas in comments:

Contact: "joe, black" <sip:[email-masked]> (don't parse, comma)

> value which must be within a quoted string containing the SIP-Date.

The BNF is such that this is true.

> is the Date header where the comma is naked.

Yes.

> in headers besides as separating values and in the SIP-Date?

I don't think its simpler. My parser handles them in all cases just
fine, and so do all the http parsers which are in a similar boat. At
this point (we are a proposed RFC, after all), a *major* parser change
like this is simply out of the question, anyway.

-Jonathan R.

-- 
Jonathan D. Rosenberg                       Lucent Technologies
Member of Technical Staff                   101 Crawfords Corner Rd.
High Speed Networks Research                Holmdel, NJ 07733
FAX:   (732) 834-5379                       Rm. 4C-526
EMAIL: [email-masked]
URL: http://www.cs.columbia.edu/~jdrosen