From 3ff82ff46d5d472e5a7a809e7f62768ab18b6021 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Tue, 4 Jul 2023 12:49:11 +0200 Subject: [PATCH] fix: fix linting issues --- src/server/keys.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/keys.js b/src/server/keys.js index 474efab..5b61aff 100644 --- a/src/server/keys.js +++ b/src/server/keys.js @@ -121,7 +121,7 @@ const fetchHKP = (id, keyserverDomain) => { fetchURL: null } - keyserverDomain = keyserverDomain || 'keys.openpgp.org' + const keyserverDomainNormalized = keyserverDomain || 'keys.openpgp.org' let query = '' if (id.includes('@')) { @@ -135,9 +135,9 @@ const fetchHKP = (id, keyserverDomain) => { 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)) { output.publicKey = await readKey({ @@ -145,7 +145,7 @@ const fetchHKP = (id, keyserverDomain) => { }) } else { try { - output.publicKey = await doipjs.keys.fetchHKP(query, keyserverDomain) + output.publicKey = await doipjs.keys.fetchHKP(query, keyserverDomainNormalized) } catch (error) { reject(new Error('No public keys could be fetched using HKP')) }