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

Re: Leading zeroes in 1*DIGIT productions

From: David Morris <dwm@xpasc.com>
Date: Thu, 18 Dec 2008 12:16:21 -0800 (PST)
cc: <ietf-http-wg@w3.org>
Message-ID: <Pine.LNX.4.33.0812181212430.5324-100000@egate.xpasc.com>


Leading zeros should be a non-problem. No where do we suggest the value is
anything but a decimal integer. Parsing leading zeros should be easier
than having to reject leading zeros. A few leading zeros sent by a sloppy
program won't impact the network.

That is a strong vote for nothing to change.

Dave Morris

On Thu, 18 Dec 2008, Julian Reschke wrote:

>
> Jeff Walden wrote:
> >
> > 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
>
> Right.
>
> > 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
>
> That would be an incompatible change, something we can't make with this
> revision.
>
> > Alternately, making it clear that leading zeroes are allowed but
> > (perhaps) MUST NOT be sent  would be acceptable.
>
> How would that help? As far as I can tell, leading zeros are totally
> harmless. Do you have evidence of problems caused by them?
>
> BR, Julian
>
Received on Thursday, 18 December 2008 20:17:04 GMT

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