-
Notifications
You must be signed in to change notification settings - Fork 101
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
Zope should not set Content-Type on empty response for exception #1089
Labels
Comments
This was referenced Jan 9, 2023
Zope 5.7.3 (Plone 6.0.0.2) has the same problem. PR #1090. |
mauritsvanrees
added a commit
to plone/plone.app.caching
that referenced
this issue
Jan 9, 2023
We must have an empty byte, not text, otherwise it is an indication that we get a possibly wrong Content-Type in a 304 status. See zopefoundation/Zope#1089. This reverts commit e6941fd.
mauritsvanrees
added a commit
to plone/plone.app.caching
that referenced
this issue
Jan 9, 2023
We must have an empty byte, not text, otherwise it is an indication that we get a possibly wrong Content-Type in a 304 status. See zopefoundation/Zope#1089. This reverts commit e6941fd.
mauritsvanrees
added a commit
to plone/plone.app.caching
that referenced
this issue
Jan 9, 2023
We must have an empty byte, not text, otherwise it is an indication that we get a possibly wrong Content-Type in a 304 status. See zopefoundation/Zope#1089. This reverts commit 52885bf.
mister-roboto
pushed a commit
to plone/buildout.coredev
that referenced
this issue
Jan 9, 2023
Branch: refs/heads/master Date: 2023-01-09T21:30:27+01:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.app.caching@da84b9d Revert changes to tests to work with the Zope security fix. We must have an empty byte, not text, otherwise it is an indication that we get a possibly wrong Content-Type in a 304 status. See zopefoundation/Zope#1089. This reverts commit e6941fdfe6c8a3c98af98f4986e6932739adfca6. Files changed: A news/1089.bugfix M plone/app/caching/tests/test_profile_with_caching_proxy.py M plone/app/caching/tests/test_profile_without_caching_proxy.py Repository: plone.app.caching Branch: refs/heads/master Date: 2023-01-09T22:45:00+01:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.app.caching@c3ee243 Merge pull request #109 from plone/maurits-fix-tests-again Revert changes to tests to work with the Zope security fix. [master] Files changed: A news/1089.bugfix M plone/app/caching/tests/test_profile_with_caching_proxy.py M plone/app/caching/tests/test_profile_without_caching_proxy.py
mister-roboto
pushed a commit
to plone/buildout.coredev
that referenced
this issue
Jan 10, 2023
Branch: refs/heads/2.x Date: 2023-01-09T21:58:03+01:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.app.caching@9accdb1 Revert changes to tests to work with the Zope security fix. We must have an empty byte, not text, otherwise it is an indication that we get a possibly wrong Content-Type in a 304 status. See zopefoundation/Zope#1089. This reverts commit 52885bf0f81ccb655196a65226e424ae74b9b253. Files changed: A news/1089.bugfix M plone/app/caching/tests/test_profile_with_caching_proxy.py M plone/app/caching/tests/test_profile_without_caching_proxy.py Repository: plone.app.caching Branch: refs/heads/2.x Date: 2023-01-09T22:48:22+01:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.app.caching@e357e9b Fixed header tests on Python 2. Files changed: M plone/app/caching/tests/test_profile_with_caching_proxy.py M plone/app/caching/tests/test_profile_without_caching_proxy.py Repository: plone.app.caching Branch: refs/heads/2.x Date: 2023-01-10T14:31:04+01:00 Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org> Commit: plone/plone.app.caching@b40e63e Merge pull request #110 from plone/maurits-fix-tests-again-2x Revert changes to tests to work with the Zope security fix. Files changed: A news/1089.bugfix M plone/app/caching/tests/test_profile_with_caching_proxy.py M plone/app/caching/tests/test_profile_without_caching_proxy.py
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See community.plone.org where @fredvd describes the problem in depth. The problem is caused by #1082 which tried to fix a regression in the Zope security fix. That is Zope 4. I need to check Zope 5 still, but I expect the same problem. Let me describe the problem here as well.
We start with Plone 5.2.10, Zope 4.8.3:
text/css
.plone(.app).caching
handles this by raising an exception:Intercepted
, with a status 304.Now the same, but with Plone 5.2.10.2, which uses Zope 4.8.6:
text/html
. The header is added by this code (Zope 4.x).text/html
. I don't know if this could be considered a bug in Varnish.Note that if you remove Varnish from this stack, the same happens to the headers, but it has no bad effect: the browser directly gets the 304 from Plone, and does not care about the changed Content-Type.
The solution as I see it: if Zope is handling an exception view and the body is empty, then do not insert a Content-Type header. This works when I try it in Plone. Is anyone wary of new regressions this would introduce?
See PR #1088 for Zope 4. I will look at Zope 5 as well.
The text was updated successfully, but these errors were encountered: