-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This fixes a regression due to a low Zope form memory limit of 1MB used since Plone 6.0.7. You can use ``dos_protection`` settings in ``etc/zope.conf`` to change the limit. See plone/Products.CMFPlone#3848 and zopefoundation/Zope#1142.
- Loading branch information
1 parent
3b4c810
commit 721833d
Showing
4 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Allow uploads up to 16 MB. | ||
This fixes a regression due to a low Zope form memory limit of 1MB used since Plone 6.0.7. | ||
You can use ``dos_protection`` settings in ``etc/zope.conf`` to change the limit. | ||
See `CMFPlone issue 3848 <https://github.com/plone/Products.CMFPlone/issues/3848>`_ and `Zope PR 1142 <https://github.com/zopefoundation/Zope/pull/1142>`_. | ||
@maurits |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# TEMPORARY patch for low form memory limit introduced in Zope 5.8.4. | ||
# See https://github.com/plone/Products.CMFPlone/issues/3848 | ||
# and https://github.com/zopefoundation/Zope/pull/1180 | ||
# Should be removed once `plone.restapi.deserializer.json_body` no longer | ||
# reads the complete request BODY in memory. | ||
from ZPublisher import HTTPRequest | ||
|
||
import logging | ||
|
||
|
||
logger = logging.getLogger(__name__) | ||
_attr = "FORM_MEMORY_LIMIT" | ||
_limit = getattr(HTTPRequest, _attr, None) | ||
if _limit and _limit == 2**20: | ||
setattr(HTTPRequest, _attr, 2**24) | ||
logger.info( | ||
"PATCH: ZPublisher.HTTPRequest.%s is at a too low default of 1MB. " | ||
"Increased it to 16MB to enable larger file uploads.", | ||
_attr, | ||
) |