mirror of
https://github.com/django/daphne.git
synced 2024-11-29 03:03:44 +03:00
Update path encoding for WebSockets
This commit is contained in:
parent
47a11fdf46
commit
8581192cad
|
@ -88,14 +88,14 @@ class WebSocketProtocol(WebSocketServerProtocol):
|
||||||
if isBinary:
|
if isBinary:
|
||||||
self.channel_layer.send("websocket.receive", {
|
self.channel_layer.send("websocket.receive", {
|
||||||
"reply_channel": self.reply_channel,
|
"reply_channel": self.reply_channel,
|
||||||
"path": self.path,
|
"path": self.unquote(self.path),
|
||||||
"order": self.packets_received,
|
"order": self.packets_received,
|
||||||
"bytes": payload,
|
"bytes": payload,
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
self.channel_layer.send("websocket.receive", {
|
self.channel_layer.send("websocket.receive", {
|
||||||
"reply_channel": self.reply_channel,
|
"reply_channel": self.reply_channel,
|
||||||
"path": self.path,
|
"path": self.unquote(self.path),
|
||||||
"order": self.packets_received,
|
"order": self.packets_received,
|
||||||
"text": payload.decode("utf8"),
|
"text": payload.decode("utf8"),
|
||||||
})
|
})
|
||||||
|
@ -123,7 +123,7 @@ class WebSocketProtocol(WebSocketServerProtocol):
|
||||||
del self.factory.reply_protocols[self.reply_channel]
|
del self.factory.reply_protocols[self.reply_channel]
|
||||||
self.channel_layer.send("websocket.disconnect", {
|
self.channel_layer.send("websocket.disconnect", {
|
||||||
"reply_channel": self.reply_channel,
|
"reply_channel": self.reply_channel,
|
||||||
"path": self.path,
|
"path": self.unquote(self.path),
|
||||||
"order": self.packets_received + 1,
|
"order": self.packets_received + 1,
|
||||||
})
|
})
|
||||||
self.factory.log_action("websocket", "disconnected", {
|
self.factory.log_action("websocket", "disconnected", {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user