From 9222676bf721ab07711760da104d793a89ea84a7 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sat, 7 Nov 2015 05:31:46 -0800 Subject: [PATCH] Change status_code to status in http.response --- channels/response.py | 4 ++-- docs/message-standards.rst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/channels/response.py b/channels/response.py index 21eb8e8..4b253d7 100644 --- a/channels/response.py +++ b/channels/response.py @@ -9,7 +9,7 @@ def encode_response(response): value = { "content_type": getattr(response, "content_type", None), "content": response.content, - "status_code": response.status_code, + "status": response.status_code, "headers": list(response._headers.values()), "cookies": [v.output(header="") for _, v in response.cookies.items()] } @@ -26,7 +26,7 @@ def decode_response(value): response = HttpResponse( content = value['content'], content_type = value['content_type'], - status = value['status_code'], + status = value['status'], ) for cookie in value['cookies']: response.cookies.load(cookie) diff --git a/docs/message-standards.rst b/docs/message-standards.rst index ae5d75b..665ac2c 100644 --- a/docs/message-standards.rst +++ b/docs/message-standards.rst @@ -59,7 +59,7 @@ Only sent on reply channels. Keys that must only be in the first message of a set: * content_type: String, mimetype of content -* status_code: Integer, numerical HTTP status code +* status: Integer, numerical HTTP status code * cookies: List of cookies to set (as encoded cookie strings suitable for headers) * headers: Dictionary of headers (key is header name, value is value, both strings)