Ticket #3057: 3057.diff

File 3057.diff, 729 bytes (added by Ivan Sagalaev <Maniac@…>, 18 years ago)

Fix

  • django/core/handlers/wsgi.py

     
    157157            return self._raw_post_data
    158158        except AttributeError:
    159159            buf = StringIO()
    160             content_length = int(self.environ['CONTENT_LENGTH'])
     160            # CONTENT_LENGTH may be absent if POST doesn't have a content at all (at least with lighttpd)
     161            content_length = int(self.environ.get('CONTENT_LENGTH', 0))
    161162            safe_copyfileobj(self.environ['wsgi.input'], buf, size=content_length)
    162163            self._raw_post_data = buf.getvalue()
    163164            buf.close()
Back to Top