The Resource dictionary is keyed by bytes, so storing unicode means you don't

get the cached resource!
This commit is contained in:
Itamar Turner-Trauring 2020-11-03 11:14:25 -05:00
parent f6eb4aef57
commit d30014f8f5

View File

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