Merge pull request #78 from MisskeyIO/readd-x-worker-host

x-worker-host を復活させる
This commit is contained in:
riku6460 2023-04-09 20:08:27 +09:00 committed by GitHub
commit caac7b6b24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -85,6 +85,12 @@ export class ServerService implements OnApplicationShutdown {
serve: false,
});
const hostname = os.hostname();
fastify.addHook('onRequest', (request, reply, done) => {
reply.header('x-worker-host', hostname);
done();
});
fastify.register(this.apiServerService.createServer, { prefix: '/api' });
fastify.register(this.openApiServerService.createServer);
fastify.register(this.fileServerService.createServer);