Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #8259 -- Handle an error situation that we should never see, bu…

…t 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
  • Loading branch information...
commit 77bf14d5817d6b8bcea26607fb52b57d0908ffac 1 parent 64ca36b
Malcolm Tredinnick authored August 23, 2008

Showing 1 changed file with 4 additions and 1 deletion. Show diff stats Hide diff stats

  1. 5  django/core/handlers/wsgi.py
5  django/core/handlers/wsgi.py
@@ -173,7 +173,10 @@ def _get_raw_post_data(self):
173 173
             try:
174 174
                 # CONTENT_LENGTH might be absent if POST doesn't have content at all (lighttpd)
175 175
                 content_length = int(self.environ.get('CONTENT_LENGTH', 0))
176  
-            except ValueError: # if CONTENT_LENGTH was empty string or not an integer
  176
+            except (ValueError, TypeError):
  177
+                # If CONTENT_LENGTH was empty string or not an integer, don't
  178
+                # error out. We've also seen None passed in here (against all
  179
+                # specs, but see ticket #8259), so we handle TypeError as well.
177 180
                 content_length = 0
178 181
             if content_length > 0:
179 182
                 safe_copyfileobj(self.environ['wsgi.input'], buf,

0 notes on commit 77bf14d

Please sign in to comment.
Something went wrong with that request. Please try again.