WebFingerリクエストで Proxy, Keep-Alive などをサポート #4658

Co-Authored-By: MeiMei <mei23@users.noreply.github.com>
This commit is contained in:
syuilo
2019-04-10 15:07:21 +09:00
parent 8468a9d4c7
commit 30172b92e6
4 changed files with 34 additions and 78 deletions

View File

@ -73,8 +73,8 @@ export async function resolveUser(username: string, host: string, option?: any,
async function resolveSelf(acctLower: string) {
logger.info(`WebFinger for ${chalk.yellow(acctLower)}`);
const finger = await webFinger(acctLower).catch(e => {
logger.error(`Failed to WebFinger for ${chalk.yellow(acctLower)}: ${e.message} (${e.status})`);
throw e;
logger.error(`Failed to WebFinger for ${chalk.yellow(acctLower)}: ${ e.statusCode || e.message }`);
throw new Error(`Failed to WebFinger for ${acctLower}: ${ e.statusCode || e.message }`);
});
const self = finger.links.find(link => link.rel && link.rel.toLowerCase() === 'self');
if (!self) {