don't convert to HTML if a resource's content has to be downloaded as attachement

git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3822 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2010-04-27 11:57:14 +00:00
parent 57f2aa94f2
commit 3f31f5c79e

View file

@ -186,7 +186,7 @@ class ResourceView(BaseView):
response.setHeader('Content-Disposition', response.setHeader('Content-Disposition',
'attachment; filename=%s' % filename) 'attachment; filename=%s' % filename)
response.setHeader('Content-Length', len(data)) response.setHeader('Content-Length', len(data))
if ct.startswith('text/'): if ct.startswith('text/') and not useAttachment:
response.setHeader('Content-Type', 'text/html') response.setHeader('Content-Type', 'text/html')
return self.renderText(data, ct) return self.renderText(data, ct)
response.setHeader('Content-Type', ct) response.setHeader('Content-Type', ct)