Alex Marandon wrote:
> 2008/5/30 Ian Bicking <[EMAIL PROTECTED]>:
>   
>> (....)
>>
>> However, there is a problem that the POST body can be eaten up.  WebOb
>> specifically tries to reconstruct it, but not for file uploads (simply
>> because I didn't get around to it, because it's harder to construct than
>> a simple POST form).  And maybe what you are encountering is this same
>> issue.
>>     
>
> Hi Ian, thanks a lot for answering my message.
>
> One thing I don't understand, is why the POST body gets
> "deconstructed" in the first place. I don't have a deep understanding
> of WSGI yet, but I thought one of its advantages was to allow
> developers to build arbitrary chains of middlewares and applications
> that are not aware of each others. So how come Pylons is modifying
> the POST body in such a way that it can't be used by subsequent WSGI
> component in the chain?
>   

I had a similar problem when mounting Trac inside a Pylons application
as a controller. Apparently, at some stage environ['wsgi.input'] was
consumed hence POST requests were seen blank by Trac once they reached it.

I solved it using this piece of middleware [1] stacked closest to the
server [2] to cache input in a regular temporary file so it can be
'rewound' before passing the request to Trac [3].

Hope it helps,
Alberto

[1]
http://beta.toscawidgets.org/trac/twWebSite/browser/twwebsite/lib/inputsaver.py
[2]
http://beta.toscawidgets.org/trac/twWebSite/browser/twwebsite/config/middleware.py#L99
[3]
http://beta.toscawidgets.org/trac/twWebSite/browser/twwebsite/controllers/tracdelegate.py#L16

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to