Re: suggestions for examples and explication wrt ABNF and header fields in draft-ietf-httpbis-p1

=JeffH wrote:
> I have some further suggestions wrt draft-ietf-httpbis-p1 section 
> "1.2.2. Basic Rules".
> 
> HTH,
> 
> =JeffH
> ------
> 
> In Section 1.2.2 Basic Rules...
> 
>  >    Many HTTP/1.1 header field values consist of words separated by
>                                                   ^^^^^
>                                                   tokens

I don't think "token" would be correct here.

>  >    whitespace or special characters.  These special characters MUST be
>  >    in a quoted string to be used within a parameter value (as defined in
>  >    Section 6.2).
> 
> The "special characters" aren't mentioned anywhere in 
> draft-ietf-httpbis-p* spec set other than the above, nor are they 
> defined in ABNF. Inspection of draft-ietf-httpbis-p1 and RFC2616 reveals 

Yes. This happened when we rewrote the ABNF not to use "prose" rules 
anymore. Unfortunately ABNF doesn't have syntax for something like "this 
set of characters, except for that other set".

> that the "special characters" are what RFC2616 defined (using ABNF) as 
> "separators". This is additionally confused in that the below tchar rule 
> directly follows the above paragraph, and it takes a few moments to 
> figure out that the below _are not_ the "special characters" (and it 
> takes even more time to determine that the "special characters" aren't 
> explicitly defined in draft-ietf-httpbis-p*).
> 
> 
>  >      tchar          = "!" / "#" / "$" / "%" / "&" / "'" / "*"
>  >                     / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
>  >                     / DIGIT / ALPHA
>  >
>  >      token          = 1*tchar
> 
> 
> I suggest rewriting the above paragraph as below, also explicitly 
> including the "separators" ABNF from RFC2616 (tho remove the SP and HT 
> from it), and list the "token" rule before the "tchar" rule, such that 
> it reads...
> 
> 
>    Many HTTP/1.1 header field values consist of tokens separated by
>    whitespace (OWS or RWS as appropriate) or separators.  These
>    separators, as well as whitespace, MUST be in a quoted string
>    to be used within a parameter value (as defined in Section 6.2).
> 
> 
>      separators     = "(" | ")" | "<" | ">" | "@"
>                     | "," | ";" | ":" | "\" | <">
>                     | "/" | "[" | "]" | "?" | "="
>                     | "{" | "}"
> 
> 
>      token          = 1*tchar
> 
> 
>      tchar          = "!" / "#" / "$" / "%" / "&" / "'" / "*"
>                     / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
>                     / DIGIT / ALPHA
> 

I have looked at this and decided to leave the prose alone for now. I 
changed the ABNF to:

     token          = 1*tchar

     tchar          = "!" / "#" / "$" / "%" / "&" / "'" / "*"
                    / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
                    / DIGIT / ALPHA
                    ; any VCHAR, except special

     special        = "(" / ")" / "<" / ">" / "@" / ","
                    / ";" / ":" / "\" / DQUOTE / "/" / "["
                    / "]" / "?" / "=" / "{" / "}"


(see <http://trac.tools.ietf.org/wg/httpbis/trac/changeset/744>).

This introduces an unused ABNF production, but I think that's ok for 
clarity.

Feedback appreciated,

Julian

Received on Friday, 8 January 2010 15:36:59 UTC