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