Changes between and of Initial VersionVersion 1Ticket #3585


Ignore:
Timestamp:
12/19/2008 07:45:08 AM (6 years ago)
Author:
exarkun
Comment:

Adjusting summary and description to more directly describe the problem, rather than describing a possible solution. The old description was:


This causes problem with the recently added twisted.web.wsgi.

If a POST Request's Content-Type equals to 'application/x-www-form-urlencoded', calling environwsgi.input?.read(...) in a wsgi app will return empty string since it had been read before in the Twisted framework.

Patch attached.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3585

    • Property Summary changed from [PATCH] Request.content should be rewinded to the beginning before Request.process is called to If the Content-Type of a request is "application/x-www-form-urlencoded", twisted.web.wsgi gives applications a zero-length input object
  • Ticket #3585 – Description

    initial v1  
    1 This causes problem with the recently added twisted.web.wsgi. 
    2  
    3 If a POST Request's Content-Type equals to 'application/x-www-form-urlencoded', calling environ['wsgi.input'].read(...) in a wsgi app will return empty string since it had been read before in the Twisted framework. 
    4  
    5 Patch attached. 
     1Sometimes `twisted.web.http.Request.requestReceived` reads from the body object (`Request.content`) and parses the result into `Request.args`.  Then it calls process.  If a `twisted.web.wsgi.WSGIResource` is getting the request, it will be passed on as the ''wsgi.input'' in the `environ` to application code.  This means that sometimes a wsgi application will get an already-read input and not be able to get the request body.