From 631ddc0efdffc9ba1d2e40389c5645ae288d3402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Acid=20Chicken=20=28=E7=A1=AB=E9=85=B8=E9=B6=8F=29?= Date: Tue, 12 Nov 2019 23:46:35 +0900 Subject: [PATCH] Update well-known.ts --- src/server/well-known.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/server/well-known.ts b/src/server/well-known.ts index 94c871eca..d326bccd2 100644 --- a/src/server/well-known.ts +++ b/src/server/well-known.ts @@ -24,6 +24,9 @@ const jrd = 'application/jrd+json'; const xrd = 'application/xrd+xml'; router.get('/.well-known/host-meta', async ctx => { + ctx.set('Access-Control-Allow-Methods', 'GET'); + ctx.set('Access-Control-Allow-Origin', '*'); + ctx.set('Access-Control-Max-Age', '31536000'); ctx.set('Content-Type', xrd); ctx.body = XRD({ element: 'Link', attributes: { type: xrd, @@ -32,6 +35,9 @@ router.get('/.well-known/host-meta', async ctx => { }); router.get('/.well-known/host-meta.json', async ctx => { + ctx.set('Access-Control-Allow-Methods', 'GET'); + ctx.set('Access-Control-Allow-Origin', '*'); + ctx.set('Access-Control-Max-Age', '31536000'); ctx.set('Content-Type', jrd); ctx.body = { links: [{ @@ -43,10 +49,17 @@ router.get('/.well-known/host-meta.json', async ctx => { }); router.get('/.well-known/nodeinfo', async ctx => { + ctx.set('Access-Control-Allow-Methods', 'GET'); + ctx.set('Access-Control-Allow-Origin', '*'); + ctx.set('Access-Control-Max-Age', '31536000'); ctx.body = { links }; }); router.get(webFingerPath, async ctx => { + ctx.set('Access-Control-Allow-Methods', 'GET'); + ctx.set('Access-Control-Allow-Origin', '*'); + ctx.set('Access-Control-Max-Age', '31536000'); + const fromId = (id: User['id']): Record => ({ id, host: null