summaryrefslogtreecommitdiff
path: root/src/server/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/api')
-rw-r--r--src/server/api/2fa.ts2
-rw-r--r--src/server/api/api-handler.ts2
-rw-r--r--src/server/api/endpoints/admin/drive/files.ts4
-rw-r--r--src/server/api/endpoints/i/update.ts16
-rw-r--r--src/server/api/streaming.ts2
5 files changed, 13 insertions, 13 deletions
diff --git a/src/server/api/2fa.ts b/src/server/api/2fa.ts
index 3bc4627a62..8e6e635bb0 100644
--- a/src/server/api/2fa.ts
+++ b/src/server/api/2fa.ts
@@ -78,7 +78,7 @@ function verifyCertificateChain(certificates: string[]) {
}
function PEMString(pemBuffer: Buffer, type = 'CERTIFICATE') {
- if (pemBuffer.length == 65 && pemBuffer[0] == 0x04) {
+ if (pemBuffer.length === 65 && pemBuffer[0] === 0x04) {
pemBuffer = Buffer.concat([PEM_PRELUDE, pemBuffer], 91);
type = 'PUBLIC KEY';
}
diff --git a/src/server/api/api-handler.ts b/src/server/api/api-handler.ts
index b147bca143..7fbc200fc0 100644
--- a/src/server/api/api-handler.ts
+++ b/src/server/api/api-handler.ts
@@ -34,7 +34,7 @@ export default (endpoint: IEndpoint, ctx: Koa.Context) => new Promise((res) => {
call(endpoint.name, user, app, body, (ctx as any).file).then((res: any) => {
reply(res);
}).catch((e: ApiError) => {
- reply(e.httpStatusCode ? e.httpStatusCode : e.kind == 'client' ? 400 : 500, e);
+ reply(e.httpStatusCode ? e.httpStatusCode : e.kind === 'client' ? 400 : 500, e);
});
}).catch(() => {
reply(403, new ApiError({
diff --git a/src/server/api/endpoints/admin/drive/files.ts b/src/server/api/endpoints/admin/drive/files.ts
index 776aec9ec6..c5a91db854 100644
--- a/src/server/api/endpoints/admin/drive/files.ts
+++ b/src/server/api/endpoints/admin/drive/files.ts
@@ -51,8 +51,8 @@ const sort: any = { // < https://github.com/Microsoft/TypeScript/issues/1863
export default define(meta, async (ps, me) => {
const q = {} as any;
- if (ps.origin == 'local') q['userHost'] = null;
- if (ps.origin == 'remote') q['userHost'] = { $ne: null };
+ if (ps.origin === 'local') q['userHost'] = null;
+ if (ps.origin === 'remote') q['userHost'] = { $ne: null };
const files = await DriveFiles.find({
where: q,
diff --git a/src/server/api/endpoints/i/update.ts b/src/server/api/endpoints/i/update.ts
index c90f050251..b33948ee0e 100644
--- a/src/server/api/endpoints/i/update.ts
+++ b/src/server/api/endpoints/i/update.ts
@@ -193,14 +193,14 @@ export default define(meta, async (ps, user, token) => {
if (ps.birthday !== undefined) profileUpdates.birthday = ps.birthday;
if (ps.avatarId !== undefined) updates.avatarId = ps.avatarId;
if (ps.bannerId !== undefined) updates.bannerId = ps.bannerId;
- if (typeof ps.isLocked == 'boolean') updates.isLocked = ps.isLocked;
- if (typeof ps.isBot == 'boolean') updates.isBot = ps.isBot;
- if (typeof ps.carefulBot == 'boolean') profileUpdates.carefulBot = ps.carefulBot;
- if (typeof ps.autoAcceptFollowed == 'boolean') profileUpdates.autoAcceptFollowed = ps.autoAcceptFollowed;
- if (typeof ps.isCat == 'boolean') updates.isCat = ps.isCat;
- if (typeof ps.autoWatch == 'boolean') profileUpdates.autoWatch = ps.autoWatch;
- if (typeof ps.injectFeaturedNote == 'boolean') profileUpdates.injectFeaturedNote = ps.injectFeaturedNote;
- if (typeof ps.alwaysMarkNsfw == 'boolean') profileUpdates.alwaysMarkNsfw = ps.alwaysMarkNsfw;
+ if (typeof ps.isLocked === 'boolean') updates.isLocked = ps.isLocked;
+ if (typeof ps.isBot === 'boolean') updates.isBot = ps.isBot;
+ if (typeof ps.carefulBot === 'boolean') profileUpdates.carefulBot = ps.carefulBot;
+ if (typeof ps.autoAcceptFollowed === 'boolean') profileUpdates.autoAcceptFollowed = ps.autoAcceptFollowed;
+ if (typeof ps.isCat === 'boolean') updates.isCat = ps.isCat;
+ if (typeof ps.autoWatch === 'boolean') profileUpdates.autoWatch = ps.autoWatch;
+ if (typeof ps.injectFeaturedNote === 'boolean') profileUpdates.injectFeaturedNote = ps.injectFeaturedNote;
+ if (typeof ps.alwaysMarkNsfw === 'boolean') profileUpdates.alwaysMarkNsfw = ps.alwaysMarkNsfw;
if (ps.avatarId) {
const avatar = await DriveFiles.findOne(ps.avatarId);
diff --git a/src/server/api/streaming.ts b/src/server/api/streaming.ts
index 6c6037db25..07869f9cbc 100644
--- a/src/server/api/streaming.ts
+++ b/src/server/api/streaming.ts
@@ -54,7 +54,7 @@ module.exports = (server: http.Server) => {
});
connection.on('message', async (data) => {
- if (data.utf8Data == 'ping') {
+ if (data.utf8Data === 'ping') {
connection.send('pong');
}
});