json_body should not read entire request BODY

Open
#1,730 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
api, backend

Research direction

Start in src/plone/restapi/deserializer/init.py at the referenced request-body handling, then read the linked CMFPlone and Zope discussions and the temporary fix in pull request 1729. Confirm the behavior with a JSON request whose body exceeds 1MB; done means large request bodies are processed without the Zope form memory-limit failure.

Written by the indexing model from the issue text.

Description

01 type: bug 12 prio: high 31 needs: help 43 lvl: complex 53 target: major 99 tag: sprint

So this line is bad:

data = json.loads(request.get("BODY") or "{}")

With Zope 5.8.4+ this fails when the request BODY is larger than 1MB.
See discussion in https://github.com/plone/Products.CMFPlone/issues/3848 and https://github.com/zopefoundation/Zope/pull/1142.
See my summary of the history and the steps taken so far.

Temporarily fixed in https://github.com/plone/plone.restapi/pull/1729 by disabling a Zope form memory limit check.

Dominant language
Python
Stars
109
Forks
107
Avg merge
2d 3h
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from plone/plone.restapi

All issues in plone/plone.restapi

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.