plone.restapi
plone.restapi copied to clipboard
Recursive / Slow request with include_item=1 combined with fullobjects=1 in query
In this case it basically loads the structure of the website 😅 (In my case 250k items)
IMHO the issues is here.
https://github.com/plone/plone.restapi/blob/df3dba9b2eff44dc6349175ffdd9e97157ac58a9/src/plone/restapi/serializer/dxcontent.py#L149-L157
If the kwarg include_items is False, but the the include_items given via query string is True. It's always True.
The LazyCatalogResultSerializer would call the SerializeFolderToJson correctly with include_items=False but it gets superseded by the query string value.
I think you never want to load all items, as full objects, recursively. I would consider it a bug 😄 but if not, why?
Possible fix:
include_items_request = self.request.form.get("include_items", include_items)
include_items_request = boolean_value(include_items_request)
if include_items and include_items_request: