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

Re: Leading zeroes in 1*DIGIT productions

From: Jeff Walden <jwalden@MIT.EDU>
Date: Mon, 22 Dec 2008 18:35:01 -0800
Message-ID: <49504E55.9030203@mit.edu>
To: Julian Reschke <julian.reschke@gmx.de>
CC: ietf-http-wg@w3.org

On 18.12.08 14:21, Julian Reschke wrote:
> Ahem, it *is* explicitly allowed by the grammar.

Yes; that doesn't mean that it doesn't look plausibly unintentional.

> And code that properly processes the value will need no special
> treatment of leading zeros, it just follows from the way decimal numbers
> work.

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 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.

Jeff

P.S. -- Yes, that's an HTTP/1.1 server written in JavaScript.  No, it's not RFC2616-compliant (yet?), but it does enough to be used in fairly extensive browser testing.
Received on Tuesday, 23 December 2008 02:37:33 GMT

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