mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-27 23:20:21 +01:00
fix: WebFinger returns 500 (#9390)
This commit is contained in:
parent
f88c5e3bbd
commit
aee09f63e1
1 changed files with 3 additions and 0 deletions
|
@ -11,6 +11,7 @@ import { NodeinfoServerService } from './NodeinfoServerService.js';
|
||||||
import type { FindOptionsWhere } from 'typeorm';
|
import type { FindOptionsWhere } from 'typeorm';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
import type { FastifyInstance, FastifyPluginOptions } from 'fastify';
|
import type { FastifyInstance, FastifyPluginOptions } from 'fastify';
|
||||||
|
import fastifyAccepts from '@fastify/accepts';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class WellKnownServerService {
|
export class WellKnownServerService {
|
||||||
|
@ -41,6 +42,8 @@ export class WellKnownServerService {
|
||||||
const jrd = 'application/jrd+json';
|
const jrd = 'application/jrd+json';
|
||||||
const xrd = 'application/xrd+xml';
|
const xrd = 'application/xrd+xml';
|
||||||
|
|
||||||
|
fastify.register(fastifyAccepts);
|
||||||
|
|
||||||
fastify.addHook('onRequest', (request, reply, done) => {
|
fastify.addHook('onRequest', (request, reply, done) => {
|
||||||
reply.header('Access-Control-Allow-Headers', 'Accept');
|
reply.header('Access-Control-Allow-Headers', 'Accept');
|
||||||
reply.header('Access-Control-Allow-Methods', 'GET, OPTIONS');
|
reply.header('Access-Control-Allow-Methods', 'GET, OPTIONS');
|
||||||
|
|
Loading…
Reference in a new issue