parent
a8fdfdccd1
commit
2eb9d5ad57
|
@ -65,8 +65,6 @@ export class ApiCallService implements OnApplicationShutdown {
|
||||||
}
|
}
|
||||||
|
|
||||||
#sendApiError(reply: FastifyReply, err: ApiError): void {
|
#sendApiError(reply: FastifyReply, err: ApiError): void {
|
||||||
this.logger.error(err);
|
|
||||||
|
|
||||||
let statusCode = err.httpStatusCode;
|
let statusCode = err.httpStatusCode;
|
||||||
if (err.httpStatusCode === 401) {
|
if (err.httpStatusCode === 401) {
|
||||||
reply.header('WWW-Authenticate', 'Bearer realm="Misskey"');
|
reply.header('WWW-Authenticate', 'Bearer realm="Misskey"');
|
||||||
|
|
|
@ -62,15 +62,6 @@ export class ApiServerService {
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
fastify.addHook('onSend', (request, reply, payload, next) => {
|
|
||||||
console.log('---- Request:', request.method, request.url);
|
|
||||||
console.log('---- body:', request.body);
|
|
||||||
|
|
||||||
console.log('---- Response:', reply.statusCode);
|
|
||||||
console.log('---- Response:', payload);
|
|
||||||
next();
|
|
||||||
});
|
|
||||||
|
|
||||||
for (const endpoint of endpoints) {
|
for (const endpoint of endpoints) {
|
||||||
const ep = {
|
const ep = {
|
||||||
name: endpoint.name,
|
name: endpoint.name,
|
||||||
|
|
Loading…
Reference in New Issue