mirror of
https://github.com/django/daphne.git
synced 2025-07-14 18:02:17 +03:00
Merge 6885e19fd7
into ba2bbffd20
This commit is contained in:
commit
e2e10c6dec
|
@ -4,6 +4,7 @@ import logging
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
from six.moves.urllib.parse import urlencode
|
from six.moves.urllib.parse import urlencode
|
||||||
|
from six import string_types
|
||||||
|
|
||||||
from autobahn.twisted.websocket import WebSocketServerProtocol, WebSocketServerFactory
|
from autobahn.twisted.websocket import WebSocketServerProtocol, WebSocketServerFactory
|
||||||
|
|
||||||
|
@ -29,6 +30,9 @@ class WebSocketProtocol(WebSocketServerProtocol):
|
||||||
# Prevent CVE-2015-0219
|
# Prevent CVE-2015-0219
|
||||||
if "_" in name:
|
if "_" in name:
|
||||||
continue
|
continue
|
||||||
|
if isinstance(value, string_types):
|
||||||
|
clean_headers[name.lower()] = value.encode("latin1")
|
||||||
|
else:
|
||||||
clean_headers[name.lower()] = value[0].encode("latin1")
|
clean_headers[name.lower()] = value[0].encode("latin1")
|
||||||
# Reconstruct query string
|
# Reconstruct query string
|
||||||
# TODO: get autobahn to provide it raw
|
# TODO: get autobahn to provide it raw
|
||||||
|
|
Loading…
Reference in New Issue
Block a user