Skip to content

Commit

Permalink
Added None check on content length.
Browse files Browse the repository at this point in the history
  • Loading branch information
kbecker42 committed Mar 16, 2023
1 parent 84215fd commit f05a6ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pybossa/api/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _preprocess_request(self, request):
content_length = request.content_length if request else 0
max_length_mb = current_app.config.get('TASK_PRESENTER_MAX_SIZE_MB', 2)
max_length_bytes = max_length_mb * 1024 * 1024 # Maximum POST data size (MB)
if content_length > max_length_bytes:
if content_length and content_length > max_length_bytes:
raise BadRequest('The task presenter/guidelines content exceeds ' +
str(max_length_mb) +
' MB. Please move large content to an external file.')
Expand Down

0 comments on commit f05a6ae

Please sign in to comment.