diff --git a/src/allmydata/test/web/test_root.py b/src/allmydata/test/web/test_root.py index 113efad5b..40bb2bf9a 100644 --- a/src/allmydata/test/web/test_root.py +++ b/src/allmydata/test/web/test_root.py @@ -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) diff --git a/src/allmydata/web/root.py b/src/allmydata/web/root.py index c638c64e3..0e241cfc3 100644 --- a/src/allmydata/web/root.py +++ b/src/allmydata/web/root.py @@ -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)