diff options
Diffstat (limited to 'server/controllers/webfinger.ts')
-rw-r--r-- | server/controllers/webfinger.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/server/controllers/webfinger.ts b/server/controllers/webfinger.ts index fc9575160..5c308d9ad 100644 --- a/server/controllers/webfinger.ts +++ b/server/controllers/webfinger.ts | |||
@@ -1,9 +1,12 @@ | |||
1 | import * as cors from 'cors' | ||
1 | import * as express from 'express' | 2 | import * as express from 'express' |
2 | import { asyncMiddleware } from '../middlewares' | 3 | import { asyncMiddleware } from '../middlewares' |
3 | import { webfingerValidator } from '../middlewares/validators' | 4 | import { webfingerValidator } from '../middlewares/validators' |
4 | 5 | ||
5 | const webfingerRouter = express.Router() | 6 | const webfingerRouter = express.Router() |
6 | 7 | ||
8 | webfingerRouter.use(cors()) | ||
9 | |||
7 | webfingerRouter.get('/.well-known/webfinger', | 10 | webfingerRouter.get('/.well-known/webfinger', |
8 | asyncMiddleware(webfingerValidator), | 11 | asyncMiddleware(webfingerValidator), |
9 | webfingerController | 12 | webfingerController |
@@ -18,7 +21,7 @@ export { | |||
18 | // --------------------------------------------------------------------------- | 21 | // --------------------------------------------------------------------------- |
19 | 22 | ||
20 | function webfingerController (req: express.Request, res: express.Response) { | 23 | function webfingerController (req: express.Request, res: express.Response) { |
21 | const actor = res.locals.actorFull | 24 | const actor = res.locals.actorUrl |
22 | 25 | ||
23 | const json = { | 26 | const json = { |
24 | subject: req.query.resource, | 27 | subject: req.query.resource, |
@@ -32,5 +35,5 @@ function webfingerController (req: express.Request, res: express.Response) { | |||
32 | ] | 35 | ] |
33 | } | 36 | } |
34 | 37 | ||
35 | return res.json(json).end() | 38 | return res.json(json) |
36 | } | 39 | } |