W3C home > Mailing lists > Public > ietf-http-wg@w3.org > October to December 2008

Leading zeroes in 1*DIGIT productions

From: Jeff Walden <jwalden@MIT.EDU>
Date: Thu, 18 Dec 2008 11:41:21 -0800
Message-ID: <494AA761.4090803@mit.edu>
To: ietf-http-wg@w3.org

Many places in RFC2616 which specify decimal numbers do so using 1*DIGIT, e.g.

first-byte-pos  = 1*DIGIT

This production admits the possibility of leading zeroes in a non-zero number, so, for example, you might have this header:

Content-Length: 017

I'm not sure whether this is intentional or not (HTTP-Version makes it explicit, but e.g. Content-Length does not), but it's slightly confusing if the number (as above) matches the common format for octal numbers, not to mention a little bit nonsensical to include gratuitous leading zeroes.  I would prefer if something like the following were used instead:

nonzero-decimal-digit  = "1" / "2" / "3" / "4" / "5" / "6" / "7" / "8" / "9"
decimal-digit   = "0" / nonzero-decimal-digit
decimal-number  = "0" / nonzero-decimal-digit*decimal-digit
first-byte-pos  = decimal-number

Alternately, making it clear that leading zeroes are allowed but (perhaps) MUST NOT be sent  would be acceptable.

Jeff
Received on Thursday, 18 December 2008 19:42:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 27 April 2012 06:50:58 GMT