mirror of
https://github.com/django/daphne.git
synced 2025-04-21 09:12:03 +03:00
Change status_code to status in http.response
This commit is contained in:
parent
7b3845b0b2
commit
9222676bf7
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user