mirror of
https://github.com/django/daphne.git
synced 2025-02-12 06:30:32 +03:00
urlencode now handles parse_qs encoding correctly.
The autobahn websocket protocol.py line 2487 uses parse_qs(query) which always returns a list as a return value. For example: urllib.parse.parse_qs('room=test') returns {'room': ['test']}. In order to parse it correctly later, doseq for urlencode must be set to True.
This commit is contained in:
parent
7b83471e6c
commit
238e75cbd3
|
@ -33,7 +33,7 @@ class WebSocketProtocol(WebSocketServerProtocol):
|
|||
clean_headers[name.lower()] = value.encode("latin1")
|
||||
# Reconstruct query string
|
||||
# TODO: get autobahn to provide it raw
|
||||
query_string = urlencode(request.params).encode("ascii")
|
||||
query_string = urlencode(request.params, doseq=True).encode("ascii")
|
||||
# Make sending channel
|
||||
self.reply_channel = self.channel_layer.new_channel("!websocket.send.?")
|
||||
# Tell main factory about it
|
||||
|
|
Loading…
Reference in New Issue
Block a user