Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
datakurre opened this issue Sep 4, 2015 · 3 comments · Fixed by #69
Closed

Comments

@datakurre
Copy link
Member

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
Copy link
Member

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
Copy link
Member Author

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

@laulaz
Copy link
Member

laulaz commented Oct 1, 2016

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

frisi added a commit that referenced this issue Jan 11, 2018
if a text/html response does not contain any data (eg empty page for an ajax request)
we do not log a warning that no csrf token could be added

this fixes #15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants