From e599b32dba39d2a19366ab5dd19d2071c7bf77c3 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Tue, 8 Dec 2020 02:56:54 +0100 Subject: [PATCH] Fix handling HKP URI --- src/keys.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/keys.js b/src/keys.js index 431bbc8..0b60975 100644 --- a/src/keys.js +++ b/src/keys.js @@ -115,7 +115,7 @@ const fetchURI = (uri) => { reject('Invalid URI') } - const re = /([a-zA-Z0-9]*):([a-zA-Z0-9@._=+\-]*)(\:[a-zA-Z0-9@._=+\-]*)?/ + const re = /([a-zA-Z0-9]*):([a-zA-Z0-9@._=+\-]*)(?:\:([a-zA-Z0-9@._=+\-]*))?/ const match = uri.match(re) if (!match[1]) { @@ -124,7 +124,7 @@ const fetchURI = (uri) => { switch (match[1]) { case 'hkp': - resolve(fetchHKP(match[2], match.length >= 4 ? match[3] : null)) + resolve(fetchHKP(match[3] ? match[3] : match[2], match[3] ? match[2] : null)) break case 'wkd': resolve(fetchWKD(match[2]))