From 3ba792cd350744bbdd8444815c058275f9bfa568 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 1 Apr 2023 12:57:14 -0400 Subject: [PATCH] *attempt to return the normal CID before manually finding its base --- src/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.ts b/src/index.ts index 643edfc..24d4306 100644 --- a/src/index.ts +++ b/src/index.ts @@ -339,6 +339,10 @@ async function handleIpnsResolve(aq: ActiveQuery) { } function getCID(cid: string): CID { + try { + return CID.parse(cid); + } catch {} + const prefix = substr(cid, 0, 1); if (!(prefix in basesByPrefix)) {