mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-19 13:07:56 +00:00
urls are bytes in Twisted
This commit is contained in:
parent
27e7e5e868
commit
2b4b8e11ce
@ -35,13 +35,12 @@ class RenderSlashUri(unittest.TestCase):
|
||||
"""
|
||||
|
||||
def setUp(self):
|
||||
self.request = DummyRequest("/uri")
|
||||
self.request = DummyRequest(b"/uri")
|
||||
self.request.fields = {}
|
||||
|
||||
def prepathURL():
|
||||
return "http://127.0.0.1.99999/{}".format(
|
||||
"/".join(self.request.prepath)
|
||||
)
|
||||
return b"http://127.0.0.1.99999/" + b"/".join(self.request.prepath)
|
||||
|
||||
self.request.prePathURL = prepathURL
|
||||
self.client = Mock()
|
||||
self.res = URIHandler(self.client)
|
||||
|
@ -75,7 +75,7 @@ class URIHandler(resource.Resource, object):
|
||||
redir_uri = redir_uri.child(urllib.quote(uri_arg).decode('utf8'))
|
||||
# add back all the query args that AREN'T "?uri="
|
||||
for k, values in req.args.items():
|
||||
if k != "uri":
|
||||
if k != b"uri":
|
||||
for v in values:
|
||||
redir_uri = redir_uri.add(k.decode('utf8'), v.decode('utf8'))
|
||||
return redirectTo(redir_uri.to_text().encode('utf8'), req)
|
||||
|
Loading…
Reference in New Issue
Block a user