Fix string in hkp

This commit is contained in:
Tankred Hase 2017-08-15 16:27:12 +08:00
parent c773da3f60
commit 21118c0b1d

View File

@ -129,8 +129,7 @@ class HKP {
const algo = (key.algorithm.indexOf('rsa') !== -1) ? 1 : ''; const algo = (key.algorithm.indexOf('rsa') !== -1) ? 1 : '';
const created = key.created ? (key.created.getTime() / 1000) : ''; const created = key.created ? (key.created.getTime() / 1000) : '';
ctx.body = `info:${VERSION}:${COUNT}\n` + ctx.body = `info:${VERSION}:${COUNT}\npub:${fp}:${algo}:${key.keySize}:${created}::\n`;
`pub:${fp}:${algo}:${key.keySize}:${created}::\n`;
for (const uid of key.userIds) { for (const uid of key.userIds) {
ctx.body += `uid:${encodeURIComponent(`${uid.name} <${uid.email}>`)}:::\n`; ctx.body += `uid:${encodeURIComponent(`${uid.name} <${uid.email}>`)}:::\n`;