Permalink
Browse files

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

…nks for the patch, Ivan Sagalaev

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4091 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 23e21df commit a2e227f2fa9e50f848a541040633acea0ab1c931 @adrianholovaty adrianholovaty committed Nov 23, 2006
Showing with 2 additions and 1 deletion.
  1. +2 −1 django/core/handlers/wsgi.py
@@ -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()
buf.close()

0 comments on commit a2e227f

Please sign in to comment.