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

Re: Leading zeroes in 1*DIGIT productions

From: Julian Reschke <julian.reschke@gmx.de>
Date: Wed, 24 Dec 2008 10:02:15 +0100
Message-ID: <4951FA97.3030604@gmx.de>
To: Jeff Walden <jwalden@MIT.EDU>
CC: ietf-http-wg@w3.org

Jeff Walden wrote:
> ...
> So actually, I do know of a server that had a problem specifically with 
> leading zeros because it was using an API which would treat such numbers 
> as octal, absent the use-base-10 hint I promptly added when I discovered 
> the problem:
> http://hg.mozilla.org/mozilla-central/file/87267825681b/netwerk/test/httpserver/httpd.js#l1520 
> I didn't bring it up initially because it's more a matter of the person 
> who wrote that line not being familiar with how parseInt works in 

Right. It is a documentation/education problem, but not with HTTP/1.1 
but with Javascript.

> JavaScript than of a deficiency in the specification, but code which 
> properly processes /most/ Content-Length values may not necessarily 
> properly process /all/ such values, in particular numbers which have the 
> format of octal numbers with leading zeroes.  I think explicitly noting 
> leading zeroes in accompanying prose makes it more likely that care will 
> be taken in processing such values.


First of all, anybody who makes this mistake is likely to find out 
*very* soon.

Furthermore, the spec already says "decimal". That implies leading 
zeros. Repeating this doesn't make the spec any clearer, just longer. 
So, in general, I'm in favor of removing redundant text such as this 
would be.

 > ...

BR, Julian
Received on Wednesday, 24 December 2008 09:03:01 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 11:10:47 UTC