From aee09f63e183917b4e80a4659ea5dc9e10857fa7 Mon Sep 17 00:00:00 2001 From: rinsuki <428rinsuki+git@gmail.com> Date: Thu, 22 Dec 2022 17:46:46 +0900 Subject: [PATCH] fix: WebFinger returns 500 (#9390) --- packages/backend/src/server/WellKnownServerService.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/backend/src/server/WellKnownServerService.ts b/packages/backend/src/server/WellKnownServerService.ts index bf0b2a09e..9bfd216cc 100644 --- a/packages/backend/src/server/WellKnownServerService.ts +++ b/packages/backend/src/server/WellKnownServerService.ts @@ -11,6 +11,7 @@ import { NodeinfoServerService } from './NodeinfoServerService.js'; import type { FindOptionsWhere } from 'typeorm'; import { bindThis } from '@/decorators.js'; import type { FastifyInstance, FastifyPluginOptions } from 'fastify'; +import fastifyAccepts from '@fastify/accepts'; @Injectable() export class WellKnownServerService { @@ -41,6 +42,8 @@ export class WellKnownServerService { const jrd = 'application/jrd+json'; const xrd = 'application/xrd+xml'; + fastify.register(fastifyAccepts); + fastify.addHook('onRequest', (request, reply, done) => { reply.header('Access-Control-Allow-Headers', 'Accept'); reply.header('Access-Control-Allow-Methods', 'GET, OPTIONS');