Commit fc4e8f1d authored by Jean-Paul Smets's avatar Jean-Paul Smets

Added comment for performance.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15222 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 839e94b1
......@@ -1090,7 +1090,8 @@ class Document(XMLObject, UrlMixIn, ConversionCacheMixin, SnapshotMixin):
else:
stripped_html = html
# find charset and convert to utf-8
charset_list = self.charset_parser.findall(str(html))
charset_list = self.charset_parser.findall(str(html)) # XXX - Not efficient is datastream
# instance but hard to do better
if charset_list:
stripped_html = unicode(stripped_html, charset_list[0]).encode('utf-8')
return stripped_html
......
......@@ -135,7 +135,8 @@ class TextDocument(Document, TextContent):
# The default is to use ERP5 Forms to render the page
return self.view()
mime, data = self.convert(format=format)
RESPONSE.setHeader('Content-Length', len(data))
RESPONSE.setHeader('Content-Length', len(str(data))) # XXX - Not efficient
# if datastream instance
RESPONSE.setHeader('Content-Type', mime)
RESPONSE.setHeader('Accept-Ranges', 'bytes')
return data
......@@ -181,7 +182,7 @@ class TextDocument(Document, TextContent):
if base_list:
return base_list[0]
return Document.getContentBaseURL(self)
def hasBaseData(self):
"""
This method is an override of dynamically generated method for Document class.
......
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