Fixed #93: Don't try to send disconnect if it never connected

This commit is contained in:
Andrew Godwin 2017-03-16 19:05:49 -07:00
parent 3cd048d594
commit d86d7dd3c4

View File

@ -190,6 +190,8 @@ class WebRequest(http.Request):
Sends a disconnect message on the http.disconnect channel.
Useful only really for long-polling.
"""
# If we don't yet have a path, then don't send as we never opened.
if self.path:
try:
self.factory.channel_layer.send("http.disconnect", {
"reply_channel": self.reply_channel,