From f300d648a87a9be76761a97acfe2061a32adcd8f Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Mon, 4 May 2015 12:01:49 +0200 Subject: [PATCH] [FIX] web: attachment with safari With Safari, the function content_disposition must return "attachment; filename=\"%s\"" % filename to avoid that Werkzeug raises an UnicodeDecodeError. Fixes #6160 opw:634205 --- addons/web/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 080025dd737..7d3862c3091 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -527,7 +527,7 @@ def content_disposition(filename, req): if browser == 'msie' and version < 9: return "attachment; filename=%s" % escaped elif browser == 'safari': - return "attachment; filename=%s" % filename + return "attachment; filename=\"%s\"" % filename else: return "attachment; filename*=UTF-8''%s" % escaped