From d30014f8f59f60cec4b9e8a5ebdd4d64df5f91a6 Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Tue, 3 Nov 2020 11:14:25 -0500 Subject: [PATCH] The Resource dictionary is keyed by bytes, so storing unicode means you don't get the cached resource! --- src/allmydata/web/storage_plugins.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/allmydata/web/storage_plugins.py b/src/allmydata/web/storage_plugins.py index 4994b23f3..939047c6e 100644 --- a/src/allmydata/web/storage_plugins.py +++ b/src/allmydata/web/storage_plugins.py @@ -27,11 +27,10 @@ class StoragePlugins(Resource, object): :see: ``twisted.web.iweb.IResource.getChild`` """ - # Technically client could be using some other encoding? - segment = segment.decode("utf-8") resources = self._client.get_client_storage_plugin_web_resources() try: - result = resources[segment] + # Technically client could be using some other encoding? + result = resources[segment.decode("utf-8")] except KeyError: result = NoResource() self.putChild(segment, result)