match query args

This commit is contained in:
meejah 2020-06-13 00:46:55 -06:00
parent 24899dae8e
commit b952ef066c

View File

@ -177,8 +177,16 @@ class _FakeTahoeUriHandler(Resource, object):
def render_GET(self, request): def render_GET(self, request):
uri = DecodedURL.from_text(request.uri.decode('utf8')) uri = DecodedURL.from_text(request.uri.decode('utf8'))
# XXX FIXME capability = None
capability = uri.query[0][1] for arg, value in uri.query:
if arg == u"uri":
capability = value
if capability is None:
raise Exception(
"No ?uri= arguent in GET '{}'".format(
uri.to_string()
)
)
if self._data is None or capability not in self._data: if self._data is None or capability not in self._data:
return u"No data for '{}'".format(capability).decode("ascii") return u"No data for '{}'".format(capability).decode("ascii")