[FIX] ir.http: make browsers trust our mime types

We determine the mime types of the files we server
automatically + manually, and browsers should not
try to second-guess it.

Browser mime-guessing is there for the myriads of
badly configured web servers out there.
This commit is contained in:
Olivier Dony
2016-07-18 19:44:37 +02:00
parent 82142475f7
commit 36e875e796
+1 -1
View File
@@ -305,7 +305,7 @@ class ir_http(osv.AbstractModel):
mimetype = attach_mimetype and attach_mimetype[0]['mimetype']
if not mimetype:
mimetype = default_mimetype
headers.append(('Content-Type', mimetype))
headers += [('Content-Type', mimetype), ('X-Content-Type-Options', 'nosniff')]
# cache
etag = hasattr(request, 'httprequest') and request.httprequest.headers.get('If-None-Match')