[#4277] Image attachments are now displayed inline instead of downloaded
diff --git a/Allura/allura/controllers/attachments.py b/Allura/allura/controllers/attachments.py
index db28504..39c4a6a 100644
--- a/Allura/allura/controllers/attachments.py
+++ b/Allura/allura/controllers/attachments.py
@@ -65,7 +65,7 @@
pass
redirect(request.referer)
embed=False
- if self.attachment.content_type and 'image/' in self.attachment.content_type:
+ if self.attachment.content_type and self.attachment.content_type.startswith('image/'):
embed = True
return self.attachment.serve(embed=embed)
diff --git a/Allura/allura/model/filesystem.py b/Allura/allura/model/filesystem.py
index 2264351..38b6c1c 100644
--- a/Allura/allura/model/filesystem.py
+++ b/Allura/allura/model/filesystem.py
@@ -90,7 +90,7 @@
'''Sets the response headers and serves as a wsgi iter'''
fp = self.rfile()
pylons.response.headers['Content-Type'] = ''
- pylons.response.content_type = fp.content_type.encode('utf-8')
+ pylons.response.content_type = self.content_type.encode('utf-8')
if not embed:
pylons.response.headers.add(
'Content-Disposition',