zopefoundation / zope.publisher

Map requests from HTTP/WebDAV clients, web browsers, XML-RPC and FTP clients onto Python objects
Other
3 stars 13 forks source link

Vendor cgi.FieldStorage #54

Closed cjwatson closed 3 years ago

cjwatson commented 4 years ago

This is approximately cgi.FieldStorage from Python 3.8, but adjusted to be compatible with both Python 2 and 3, and with some parts removed that BrowserRequest doesn't need.

Fixes #39.

I also applied the patch from https://github.com/python/cpython/pull/21457 to fix parsing of simple request bodies with Content-Length and no Content-Disposition.

My preference would be to apply #55 instead of this, which I think is much easier to follow and much less code to maintain. However, since the issue has been a bit controversial, I'm posting both so that other people can see what they think.

jugmac00 commented 4 years ago

I also applied the patch from python/cpython#21457 to fix parsing of simple request bodies with Content-Length and no Content-Disposition.

There seems to be a problem with the mentioned patch:

https://github.com/python/cpython/pull/21457#issuecomment-698845895

icemac commented 4 years ago

According to the contributor agreement vendoring code is not so easy. It reads: "It is assumed that you wrote the software or changes yourself; if other people wrote or changed parts, we will likely need Assignment Agreements from them as well." So prefer #55, too.

cjwatson commented 3 years ago

I'm withdrawing this in favour of #55.