Graham Dumpleton wrote: > ""The application should not attempt to read more data than is > specified by the CONTENT_LENGTH variable.""" > > is actually a bit bogus. > > This is because a WSGI middleware component or web server could be > acting as an input filter and decompressing a content encoding of gzip > for request. Since it knows the size will change but will not know > what the new size would be, except by buffering it all, it by rights > should remove CONTENT_LENGTH. This presents a problem for an > application as no CONTENT_LENGTH then to rely on to know whether it > has read to much input. If you leave CONTENT_LENGTH intact, it may > think it has read everything when there is in fact more.
I thought leaving it out might be a good way to indicate content-length-unknown, but now I'm not so sure. I think a better indication is "-1", which works with cgi.FieldStorage and lots of other code, and generally .read(-1) means "give me everything you have". -- Ian Bicking | [EMAIL PROTECTED] | http://blog.ianbicking.org | Write code, do good | http://topp.openplans.org/careers _______________________________________________ Web-SIG mailing list Web-SIG@python.org Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com