[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
This commit is contained in:
Olivier Dony
2015-10-22 17:40:33 +02:00
parent 6c8e53a087
commit 807e776ac8
+1 -1
View File
@@ -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