[FIX] website: default mimetype for web-published attachments, avoids crash
authorOlivier Dony <odo@openerp.com>
Wed, 25 Jun 2014 16:37:03 +0000 (18:37 +0200)
committerOlivier Dony <odo@openerp.com>
Wed, 25 Jun 2014 16:37:03 +0000 (18:37 +0200)
addons/website/models/ir_http.py

index 9250a2f..75a665f 100644 (file)
@@ -120,7 +120,7 @@ class ir_http(orm.AbstractModel):
             if response.status_code == 304:
                 return response
 
-            response.mimetype = attach[0]['mimetype']
+            response.mimetype = attach[0]['mimetype'] or 'application/octet-stream'
             response.data = datas.decode('base64')
             return response