[mod_python] util.FieldStorage wrong about method restrictions

Mike Looijmans nlv11281 at natlab.research.philips.com
Mon Aug 14 09:24:04 EDT 2006


>>>Really that is the only difference. Which is why both cgi.FieldStorage
>>>and util.FieldStorage should allow PUT as well as POST.
>>
>>Your patch will also break any existing code that uses PUT to upload files to the server in any 
>>form. By assuming that the body contains form data, the FieldStorage object will consume the body 
>>and it is lost for the request.
> 
> Will it?
> util.FieldStorage tests the content type before doing anything.

You never know what a client might provide as content-type.

> Also, why would you use util.FieldStorage to retrieve a submitted
> file? Surely you'd just read it?

One might want to allow something like:
http://my.server/upload/filename?access=755&sendmail=true
and use a fieldstorage to parse the URL.


Mike.



More information about the Mod_python mailing list