mirror of
https://github.com/django/daphne.git
synced 2024-11-25 09:13:44 +03:00
Don't decode + in URLs
This commit is contained in:
parent
9fd113dca5
commit
13bac47d70
|
@ -4,7 +4,7 @@ import logging
|
||||||
import six
|
import six
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from six.moves.urllib_parse import unquote_plus
|
from six.moves.urllib_parse import unquote
|
||||||
from twisted.protocols.policies import ProtocolWrapper
|
from twisted.protocols.policies import ProtocolWrapper
|
||||||
from twisted.web import http
|
from twisted.web import http
|
||||||
|
|
||||||
|
@ -124,9 +124,9 @@ class WebRequest(http.Request):
|
||||||
Python 2 and 3 compat layer for utf-8 unquoting
|
Python 2 and 3 compat layer for utf-8 unquoting
|
||||||
"""
|
"""
|
||||||
if six.PY2:
|
if six.PY2:
|
||||||
return unquote_plus(value).decode("utf8")
|
return unquote(value).decode("utf8")
|
||||||
else:
|
else:
|
||||||
return unquote_plus(value.decode("ascii"))
|
return unquote(value.decode("ascii"))
|
||||||
|
|
||||||
def send_disconnect(self):
|
def send_disconnect(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -4,7 +4,7 @@ import logging
|
||||||
import six
|
import six
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
from six.moves.urllib_parse import unquote_plus, urlencode
|
from six.moves.urllib_parse import unquote, urlencode
|
||||||
|
|
||||||
from autobahn.twisted.websocket import WebSocketServerProtocol, WebSocketServerFactory
|
from autobahn.twisted.websocket import WebSocketServerProtocol, WebSocketServerFactory
|
||||||
|
|
||||||
|
@ -68,9 +68,9 @@ class WebSocketProtocol(WebSocketServerProtocol):
|
||||||
Python 2 and 3 compat layer for utf-8 unquoting
|
Python 2 and 3 compat layer for utf-8 unquoting
|
||||||
"""
|
"""
|
||||||
if six.PY2:
|
if six.PY2:
|
||||||
return unquote_plus(value).decode("utf8")
|
return unquote(value).decode("utf8")
|
||||||
else:
|
else:
|
||||||
return unquote_plus(value.decode("ascii"))
|
return unquote(value.decode("ascii"))
|
||||||
|
|
||||||
def onOpen(self):
|
def onOpen(self):
|
||||||
# Send news that this channel is open
|
# Send news that this channel is open
|
||||||
|
|
Loading…
Reference in New Issue
Block a user