mirror of
https://github.com/django/daphne.git
synced 2024-11-21 23:46:33 +03:00
Fixed #169: Don't try to send messages to a closed client
This commit is contained in:
parent
f53eb0dda6
commit
de0811f13e
|
@ -189,8 +189,13 @@ class WebRequest(http.Request):
|
||||||
"""
|
"""
|
||||||
Handles a reply from the client
|
Handles a reply from the client
|
||||||
"""
|
"""
|
||||||
|
# Handle connections that are already closed
|
||||||
|
if self.channel is None:
|
||||||
|
return
|
||||||
|
# Check message validity
|
||||||
if "type" not in message:
|
if "type" not in message:
|
||||||
raise ValueError("Message has no type defined")
|
raise ValueError("Message has no type defined")
|
||||||
|
# Handle message
|
||||||
if message["type"] == "http.response.start":
|
if message["type"] == "http.response.start":
|
||||||
if self._response_started:
|
if self._response_started:
|
||||||
raise ValueError("HTTP response has already been started")
|
raise ValueError("HTTP response has already been started")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user