[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user