1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[1.10.x] Fixed #27005 -- Fixed crash if request.META[''CONTENT_LENGTH']=''.

Backport of 5c63b3e5a7 from master
This commit is contained in:
Tim Graham
2016-08-03 12:46:57 -04:00
parent 348406c381
commit dcebeea270
3 changed files with 8 additions and 1 deletions

View File

@@ -264,7 +264,7 @@ class HttpRequest(object):
# Limit the maximum request data size that will be handled in-memory.
if (settings.DATA_UPLOAD_MAX_MEMORY_SIZE is not None and
int(self.META.get('CONTENT_LENGTH', 0)) > settings.DATA_UPLOAD_MAX_MEMORY_SIZE):
int(self.META.get('CONTENT_LENGTH') or 0) > settings.DATA_UPLOAD_MAX_MEMORY_SIZE):
raise RequestDataTooBig('Request body exceeded settings.DATA_UPLOAD_MAX_MEMORY_SIZE.')
try: