From 807e776ac82ca4fbfe04d552d94fbc38d3e98d05 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Thu, 22 Oct 2015 09:27:03 +0200 Subject: [PATCH] [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 --- 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 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