[FIX] website: default mimetype for web-published attachments, avoids crash
[odoo/odoo.git] / 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