plone / plone.protect

HTTP protection utilities for the Plone CMS
https://pypi.org/project/plone.protect/
7 stars 8 forks source link

ProtectTransform gives warning when trying and failing to parse response with empty body #15

Closed datakurre closed 6 years ago

datakurre commented 9 years ago

If response is a stream iterator with text/html content type plone.protect tries to parse it even its response.body is an empty string. (A special case with stream iterator responses.)

2015-09-04 20:19:51 WARNING plone.protect error parsing dom, failure to add csrf token to response for url http://localhost:8080/Plone/sample-folder/copy_of_front-page/++contentlayout++default/document.html

Maybe plone.protect should check and not parse if not result (allow it to be empty string).

mauritsvanrees commented 9 years ago

Is this still a problem? How can we reproduce this?

plone.protect has had several releases lately, which may have fixed this. I have just released 3.0.16. See the versions list on the hotfix page: https://plone.org/products/plone-hotfix/releases/20151006

datakurre commented 9 years ago

This was seen with Mosaic, when rendering a mosaic view. @vangheem @agitator ?

laulaz commented 8 years ago

For the record, this hasn't change in plone.protect = 3.0.20 & plone4.csrffixes = 1.1.