Fix a long-standing bug which caused `max_upload_size` to not be correctly enforced.