Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #3057 -- Changed WSGI handler not to expect CONTENT_LENGTH. Tha…

…nks for the patch, Ivan Sagalaev

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a2e227f2fa9e50f848a541040633acea0ab1c931 1 parent 23e21df
Adrian Holovaty adrianholovaty authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  django/core/handlers/
3  django/core/handlers/
@@ -157,7 +157,8 @@ def _get_raw_post_data(self):
return self._raw_post_data
except AttributeError:
buf = StringIO()
- content_length = int(self.environ['CONTENT_LENGTH'])
+ # CONTENT_LENGTH might be absent if POST doesn't have content at all (lighttpd)
+ content_length = int(self.environ.get('CONTENT_LENGTH', ))
safe_copyfileobj(self.environ['wsgi.input'], buf, size=content_length)
self._raw_post_data = buf.getvalue()
Please sign in to comment.
Something went wrong with that request. Please try again.