Django

Code

Changeset 6592

Show
Ignore:
Timestamp:
10/21/07 18:52:08 (1 year ago)
Author:
mtredinnick
Message:

Fixed #3496 -- Handle the case of missing (and hence '0') Content-Length header
in a POST to the wsgi handler. Based on a patch from Mikko Ohtamaa.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/handlers/wsgi.py

    r6550 r6592  
    166166            except ValueError: # if CONTENT_LENGTH was empty string or not an integer 
    167167                content_length = 0 
    168             safe_copyfileobj(self.environ['wsgi.input'], buf, size=content_length) 
     168            if content_length > 0: 
     169                safe_copyfileobj(self.environ['wsgi.input'], buf, 
     170                        size=content_length) 
    169171            self._raw_post_data = buf.getvalue() 
    170172            buf.close()