Ticket #3496: wsgi_patch.diff
File wsgi_patch.diff, 1.2 KB (added by , 18 years ago) |
---|
-
django/core/handlers/wsgi.py
160 160 try: 161 161 # CONTENT_LENGTH might be absent if POST doesn't have content at all (lighttpd) 162 162 content_length = int(self.environ.get('CONTENT_LENGTH', 0)) 163 has_content_length = True 163 164 except ValueError: # if CONTENT_LENGTH was empty string or not an integer 164 165 content_length = 0 165 safe_copyfileobj(self.environ['wsgi.input'], buf, size=content_length) 166 has_content_length = False 167 168 if has_content_length and content_length == 0: 169 # A case when HTML form containing only empty checkboxes 170 # is submitted. It POSTs zero length HTTP request. 171 # 172 # Socket read doesn't return if we pass size=0 173 # forward this point and Django request handling hangs. 174 pass 175 else: 176 safe_copyfileobj(self.environ['wsgi.input'], buf, size=content_length) 177 166 178 self._raw_post_data = buf.getvalue() 167 179 buf.close() 168 180 return self._raw_post_data