Commit 48868e86 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

Base, WebSection, OOoDocumentExtensibleTraversableMixin: do not compute the...

Base, WebSection, OOoDocumentExtensibleTraversableMixin: do not compute the response body in 304 Not Modified response case.
parent bce7ee1e
......@@ -49,7 +49,6 @@ class OOoDocumentExtensibleTraversableMixin(BaseExtensibleTraversableMixin):
web_cache_kw = {'name': name,
'format': EMBEDDED_FORMAT}
try:
self._convert(format='html')
view = _ViewEmulator().__of__(self)
# call caching policy manager.
_setCacheHeaders(view, web_cache_kw)
......@@ -57,6 +56,7 @@ class OOoDocumentExtensibleTraversableMixin(BaseExtensibleTraversableMixin):
# no content
if _checkConditionalGET(view, web_cache_kw):
return ''
self._convert(format='html')
mime, data = self.getConversion(format=EMBEDDED_FORMAT, filename=name)
document = OFSFile(name, name, data, content_type=mime).__of__(self.aq_parent)
except (NotConvertedError, ConversionError, KeyError):
......
......@@ -255,7 +255,6 @@ class WebSection(Domain, DocumentExtensibleTraversableMixin):
if custom_render_method_id is not None:
if document is None:
document = self
result = getattr(document, custom_render_method_id)()
view = _ViewEmulator().__of__(self)
# call caching policy manager.
_setCacheHeaders(view, {})
......@@ -263,6 +262,7 @@ class WebSection(Domain, DocumentExtensibleTraversableMixin):
# no content
if _checkConditionalGET(view, extra_context={}):
return ''
result = getattr(document, custom_render_method_id)()
return result
elif document is not None:
return document()
......
......@@ -2551,7 +2551,6 @@ class Base(
security.declareProtected(Permissions.View, 'view')
def view(self):
"""Returns the default view even if index_html is overridden"""
result = self._renderDefaultView('view')
view = _ViewEmulator().__of__(self)
# call caching policy manager.
_setCacheHeaders(view, {})
......@@ -2559,6 +2558,7 @@ class Base(
# no content
if _checkConditionalGET(view, extra_context={}):
return ''
result = self._renderDefaultView('view')
return result
# Default views - the default security in CMFCore
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment