mirror of
https://github.com/django/daphne.git
synced 2024-11-25 01:03:45 +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 time
|
||||
|
||||
from six.moves.urllib_parse import unquote_plus
|
||||
from six.moves.urllib_parse import unquote
|
||||
from twisted.protocols.policies import ProtocolWrapper
|
||||
from twisted.web import http
|
||||
|
||||
|
@ -124,9 +124,9 @@ class WebRequest(http.Request):
|
|||
Python 2 and 3 compat layer for utf-8 unquoting
|
||||
"""
|
||||
if six.PY2:
|
||||
return unquote_plus(value).decode("utf8")
|
||||
return unquote(value).decode("utf8")
|
||||
else:
|
||||
return unquote_plus(value.decode("ascii"))
|
||||
return unquote(value.decode("ascii"))
|
||||
|
||||
def send_disconnect(self):
|
||||
"""
|
||||
|
|
|
@ -4,7 +4,7 @@ import logging
|
|||
import six
|
||||
import time
|
||||
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
|
||||
|
||||
|
@ -68,9 +68,9 @@ class WebSocketProtocol(WebSocketServerProtocol):
|
|||
Python 2 and 3 compat layer for utf-8 unquoting
|
||||
"""
|
||||
if six.PY2:
|
||||
return unquote_plus(value).decode("utf8")
|
||||
return unquote(value).decode("utf8")
|
||||
else:
|
||||
return unquote_plus(value.decode("ascii"))
|
||||
return unquote(value.decode("ascii"))
|
||||
|
||||
def onOpen(self):
|
||||
# Send news that this channel is open
|
||||
|
|
Loading…
Reference in New Issue
Block a user