summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2006-11-23 17:06:11 +0000
committerAdrian Holovaty <adrian@holovaty.com>2006-11-23 17:06:11 +0000
commita2e227f2fa9e50f848a541040633acea0ab1c931 (patch)
tree42d2fd28eea477f482d8d77fa9e8d190c1c61967
parent23e21df9ca9d9605f076fa395fa6f1547958305f (diff)
Fixed #3057 -- Changed WSGI handler not to expect CONTENT_LENGTH. Thanks for the patch, Ivan Sagalaev
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4091 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/core/handlers/wsgi.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/core/handlers/wsgi.py b/django/core/handlers/wsgi.py
index 2998bd31f6..0f867851fc 100644
--- a/django/core/handlers/wsgi.py
+++ b/django/core/handlers/wsgi.py
@@ -157,7 +157,8 @@ class WSGIRequest(http.HttpRequest):
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()