1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-11-24 23:26:17 +09:00

fix: WebFinger returns 500 (#9390)

This commit is contained in:
rinsuki 2022-12-22 17:46:46 +09:00 committed by GitHub
parent f88c5e3bbd
commit aee09f63e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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');