mirror of
https://github.com/django/daphne.git
synced 2024-11-21 23:46:33 +03:00
Fixed issue where some headers would come through with only 1 character
This commit is contained in:
parent
ba2bbffd20
commit
6885e19fd7
|
@ -4,6 +4,7 @@ import logging
|
|||
import time
|
||||
import traceback
|
||||
from six.moves.urllib.parse import urlencode
|
||||
from six import string_types
|
||||
|
||||
from autobahn.twisted.websocket import WebSocketServerProtocol, WebSocketServerFactory
|
||||
|
||||
|
@ -29,7 +30,10 @@ class WebSocketProtocol(WebSocketServerProtocol):
|
|||
# Prevent CVE-2015-0219
|
||||
if "_" in name:
|
||||
continue
|
||||
clean_headers[name.lower()] = value[0].encode("latin1")
|
||||
if isinstance(value, string_types):
|
||||
clean_headers[name.lower()] = value.encode("latin1")
|
||||
else:
|
||||
clean_headers[name.lower()] = value[0].encode("latin1")
|
||||
# Reconstruct query string
|
||||
# TODO: get autobahn to provide it raw
|
||||
query_string = urlencode(request.params).encode("ascii")
|
||||
|
|
Loading…
Reference in New Issue
Block a user