forked from Mirrors/keyoxide-web
fix: fix linting issues
This commit is contained in:
parent
375173ecdf
commit
3ff82ff46d
1 changed files with 4 additions and 4 deletions
|
@ -121,7 +121,7 @@ const fetchHKP = (id, keyserverDomain) => {
|
||||||
fetchURL: null
|
fetchURL: null
|
||||||
}
|
}
|
||||||
|
|
||||||
keyserverDomain = keyserverDomain || 'keys.openpgp.org'
|
const keyserverDomainNormalized = keyserverDomain || 'keys.openpgp.org'
|
||||||
|
|
||||||
let query = ''
|
let query = ''
|
||||||
if (id.includes('@')) {
|
if (id.includes('@')) {
|
||||||
|
@ -135,9 +135,9 @@ const fetchHKP = (id, keyserverDomain) => {
|
||||||
query = `0x${sanitizedId}`
|
query = `0x${sanitizedId}`
|
||||||
}
|
}
|
||||||
|
|
||||||
output.fetchURL = `https://${keyserverDomain}/pks/lookup?op=get&options=mr&search=${query}`
|
output.fetchURL = `https://${keyserverDomainNormalized}/pks/lookup?op=get&options=mr&search=${query}`
|
||||||
|
|
||||||
const hash = createHash('md5').update(`${query}__${keyserverDomain}`).digest('hex')
|
const hash = createHash('md5').update(`${query}__${keyserverDomainNormalized}`).digest('hex')
|
||||||
|
|
||||||
if (c && await c.get(hash)) {
|
if (c && await c.get(hash)) {
|
||||||
output.publicKey = await readKey({
|
output.publicKey = await readKey({
|
||||||
|
@ -145,7 +145,7 @@ const fetchHKP = (id, keyserverDomain) => {
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
output.publicKey = await doipjs.keys.fetchHKP(query, keyserverDomain)
|
output.publicKey = await doipjs.keys.fetchHKP(query, keyserverDomainNormalized)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
reject(new Error('No public keys could be fetched using HKP'))
|
reject(new Error('No public keys could be fetched using HKP'))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue