#2509 closed enhancement (worksforme)
Patch to consolidate all FieldStorage variants
Reported by: | Owned by: | Christopher Lenz | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | version control/browser | Version: | devel |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
After a discussion with cmlenz related to issues I was having with an XML-RPC plugin, he suggested using cgi.FieldStorage for all Request subclasses.
This patch implements that proposal by moving web.cgi.TracFieldStorage into web.api and removing the redundant implementations.
Without this patch mod_pythons fake FieldStorage fails if an XML-RPC client POSTs to an IRequestHandler.
Attachments (3)
Change History (13)
by , 19 years ago
Attachment: | trac-field-storage.diff added |
---|
comment:1 by , 19 years ago
Component: | browser → mod_python frontend |
---|---|
Milestone: | 0.9.3 → 1.0 |
Owner: | changed from | to
Status: | new → assigned |
To put this in some context, I suggested using the cgi.FieldStorage
class everywhere, instead of using the mod_python provided implementation in the mod_python frontend, which has causes various subtle problems in the past.
Also, when we migrate to WSGI, we'll be not be using the mod_python FieldStorage
implementation anyway.
comment:2 by , 19 years ago
Component: | mod_python frontend → browser |
---|---|
Milestone: | 1.0 → 0.9.3 |
I have updated the patch to better emulate the CGI environment under mod_python by setting envCONTENT_TYPE and envCONTENT_LENGTH if available.
I also added a check to the constructor of trac.web.api.FieldStorage for the case where no fields are parsed, which previously caused an exception in popluate_hdf().
comment:3 by , 19 years ago
I'm not 100% convinced that overriding read_single() is a good idea, but without it cgi.FieldStorage consumes all of the input stream if the content-type is unexpected (eg. text/xml).
comment:4 by , 19 years ago
I encountered some similar problems with the FieldStorage when I was experimenting with XML-RPC a while back. I'll take another look at how I was addressing it to see if it helps at all.
comment:5 by , 19 years ago
I've created an XmlRpcPlugin for Trac. Permission enforcement is not implemented yet, and only a couple of ticket manipulation functions are exported, but it is looking promising.
comment:6 by , 19 years ago
This last patch has some minor changes, passing the mod_python headers directly to FieldStorage. I haven't noticed any issues as yet.
comment:7 by , 19 years ago
Milestone: | 0.9.3 → 1.0 |
---|
comment:9 by , 19 years ago
Resolution: | → worksforme |
---|---|
Status: | assigned → closed |
comment:10 by , 19 years ago
Milestone: | 1.0 |
---|
Implementation of patch