Fix handling HKP URI

This commit is contained in:
Yarmo Mackenbach 2020-12-08 02:56:54 +01:00
parent 607f0434b9
commit e599b32dba

View file

@ -115,7 +115,7 @@ const fetchURI = (uri) => {
reject('Invalid 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) const match = uri.match(re)
if (!match[1]) { if (!match[1]) {
@ -124,7 +124,7 @@ const fetchURI = (uri) => {
switch (match[1]) { switch (match[1]) {
case 'hkp': 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 break
case 'wkd': case 'wkd':
resolve(fetchWKD(match[2])) resolve(fetchWKD(match[2]))