From d3ed2761b9f007fae6977fdbf136619bce498c98 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 5 Apr 2018 15:54:12 +0900 Subject: [PATCH] wip --- src/server/webfinger.ts | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/server/webfinger.ts b/src/server/webfinger.ts index 20057da31..fd7ebc3fb 100644 --- a/src/server/webfinger.ts +++ b/src/server/webfinger.ts @@ -1,11 +1,12 @@ +import * as express from 'express'; + import config from '../config'; import parseAcct from '../acct/parse'; import User from '../models/user'; -const express = require('express'); const app = express(); -app.get('/.well-known/webfinger', async (req, res) => { +app.get('/.well-known/webfinger', async (req: express.Request, res: express.Response) => { if (typeof req.query.resource !== 'string') { return res.sendStatus(400); } @@ -34,13 +35,15 @@ app.get('/.well-known/webfinger', async (req, res) => { return res.json({ subject: `acct:${user.username}@${config.host}`, - links: [ - { - rel: 'self', - type: 'application/activity+json', - href: `${config.url}/@${user.username}` - } - ] + links: [{ + rel: 'self', + type: 'application/activity+json', + href: `${config.url}/@${user.username}` + }, { + rel: 'http://webfinger.net/rel/profile-page', + type: 'text/html', + href: `${config.url}/@${user.username}` + }] }); });