summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorOlivier Dony <odo@openerp.com>2015-10-22 09:27:03 +0200
committerOlivier Dony <odo@openerp.com>2015-10-22 17:40:33 +0200
commit807e776ac82ca4fbfe04d552d94fbc38d3e98d05 (patch)
tree3a8a53556c09f71f02854740c669eafb419c5546 /addons
parent6c8e53a08705b948833fa58d3c5dc182ebb889c4 (diff)
[FIX] web: /web/image: conforming HTTP status line
HTTP status lines are required to have both a status code *and* a "reason phrase". Some stricter HTTP clients / proxies choke on status lines without "reason". Technically, setting `response.status` is supposed to set both at the same time, so we need to provide both, or to set `status_code` only and let werkzeug add the reason. This patch does the latter. Fixes #8924
Diffstat (limited to 'addons')
-rw-r--r--addons/web/controllers/main.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py
index 7b5cebf71e4..d90e86c34d4 100644
--- a/addons/web/controllers/main.py
+++ b/addons/web/controllers/main.py
@@ -1088,7 +1088,7 @@ class Binary(http.Controller):
image_base64 = content and base64.b64decode(content) or self.placeholder()
headers.append(('Content-Length', len(image_base64)))
response = request.make_response(image_base64, headers)
- response.status = str(status)
+ response.status_code = status
return response
# backward compatibility