From 471510f08ed699373e763ae6021723bfd27dc020 Mon Sep 17 00:00:00 2001 From: Sarah Date: Sun, 17 Oct 2021 03:37:56 +0200 Subject: [PATCH] ffs --- peerix/local.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/peerix/local.py b/peerix/local.py index ceaed54..7bed959 100644 --- a/peerix/local.py +++ b/peerix/local.py @@ -61,9 +61,11 @@ class LocalStore(Store): if resp.status == 404: return None info = NarInfo.parse(await resp.text()) - return info._replace(url=base64.b64encode(info.storePath.encode("utf-8")).replace(b"/", b"_").decode("ascii")) + return info._replace(url=base64.b64encode(info.storePath.encode("utf-8")).replace(b"/", b"_").decode("ascii")+".nar") async def nar(self, sp: str) -> t.AsyncIterable[bytes]: + if sp.endswith(".nar"): + sp = sp[:-4] path = base64.b64decode(sp.replace("_", "/")).decode("utf-8") if not path.startswith((await self.cache_info()).storeDir): raise FileNotFoundError()