mirror of https://github.com/django/django.git
Fixed #8259 -- Handle an error situation that we should never see, but still
occurs for some reason (be liberal in what you accept, and all that). Patch from kevin. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8495 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
64ca36bf08
commit
77bf14d581
|
@ -173,7 +173,10 @@ class WSGIRequest(http.HttpRequest):
|
|||
try:
|
||||
# CONTENT_LENGTH might be absent if POST doesn't have content at all (lighttpd)
|
||||
content_length = int(self.environ.get('CONTENT_LENGTH', 0))
|
||||
except ValueError: # if CONTENT_LENGTH was empty string or not an integer
|
||||
except (ValueError, TypeError):
|
||||
# If CONTENT_LENGTH was empty string or not an integer, don't
|
||||
# error out. We've also seen None passed in here (against all
|
||||
# specs, but see ticket #8259), so we handle TypeError as well.
|
||||
content_length = 0
|
||||
if content_length > 0:
|
||||
safe_copyfileobj(self.environ['wsgi.input'], buf,
|
||||
|
|
Loading…
Reference in New Issue