From 60b2842203ac6b2cae192dcead4e97cd55960815 Mon Sep 17 00:00:00 2001 From: Mar0xy Date: Sun, 24 Sep 2023 23:25:04 +0200 Subject: [PATCH] chore: lint --- .../src/server/api/mastodon/MastodonApiServerService.ts | 6 +++--- .../backend/src/server/oauth/OAuth2ProviderService.ts | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts b/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts index 4bd6f1ac8..128cb3491 100644 --- a/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts +++ b/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts @@ -46,12 +46,12 @@ export class MastodonApiServerService { done(); }); - fastify.addContentTypeParser('application/x-www-form-urlencoded', function (request, payload, done) { + fastify.addContentTypeParser('application/x-www-form-urlencoded', (request, payload, done) => { let body = ''; - payload.on('data', function (data) { + payload.on('data', (data) => { body += data; }); - payload.on('end', function () { + payload.on('end', () => { try { const parsed = querystring.parse(body); done(null, parsed); diff --git a/packages/backend/src/server/oauth/OAuth2ProviderService.ts b/packages/backend/src/server/oauth/OAuth2ProviderService.ts index 5b0850b9b..ad2657a97 100644 --- a/packages/backend/src/server/oauth/OAuth2ProviderService.ts +++ b/packages/backend/src/server/oauth/OAuth2ProviderService.ts @@ -51,12 +51,12 @@ export class OAuth2ProviderService { done(); }); - fastify.addContentTypeParser('application/x-www-form-urlencoded', function (request, payload, done) { + fastify.addContentTypeParser('application/x-www-form-urlencoded', (request, payload, done) => { let body = ''; - payload.on('data', function (data) { + payload.on('data', (data) => { body += data; }); - payload.on('end', function () { + payload.on('end', () => { try { const parsed = querystring.parse(body); done(null, parsed); @@ -122,7 +122,7 @@ export class OAuth2ProviderService { }; reply.send(ret); } catch (err: any) { - console.error(err); + /* console.error(err); */ reply.code(401).send(err.response.data); } });