Don't decode + in URLs

This commit is contained in:
Andrew Godwin 2016-04-27 09:50:39 +01:00
parent 9fd113dca5
commit 13bac47d70
2 changed files with 6 additions and 6 deletions

View File

@ -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):
"""

View File

@ -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