From c3edc92436e474b257831f191888a98b4a42024f Mon Sep 17 00:00:00 2001 From: roschaefer Date: Tue, 20 Aug 2019 14:06:24 +0200 Subject: [PATCH] Fix lint --- backend/src/activitypub/ActivityPub.js | 15 ++++++++------- backend/src/activitypub/security/index.js | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/backend/src/activitypub/ActivityPub.js b/backend/src/activitypub/ActivityPub.js index cd16f620e..01e95d4f4 100644 --- a/backend/src/activitypub/ActivityPub.js +++ b/backend/src/activitypub/ActivityPub.js @@ -102,27 +102,27 @@ export default class ActivityPub { handleUndoActivity(activity) { debug('inside UNDO') switch (activity.object.type) { - case 'Follow': + case 'Follow': { const followActivity = activity.object return this.dataSource.undoFollowActivity(followActivity.actor, followActivity.object) - case 'Like': + } + case 'Like': { return this.dataSource.deleteShouted(activity) - default: + } } } handleCreateActivity(activity) { debug('inside create') switch (activity.object.type) { - case 'Article': - case 'Note': + case 'Note': { const articleObject = activity.object if (articleObject.inReplyTo) { return this.dataSource.createComment(activity) } else { return this.dataSource.createPost(activity) } - default: + } } } @@ -159,13 +159,14 @@ export default class ActivityPub { async handleAcceptActivity(activity) { debug('inside accept') switch (activity.object.type) { - case 'Follow': + case 'Follow': { const followObject = activity.object const followingCollectionPage = await this.collections.getFollowingCollectionPage( followObject.actor, ) followingCollectionPage.orderedItems.push(followObject.object) await this.dataSource.saveFollowingCollectionPage(followingCollectionPage) + } } } diff --git a/backend/src/activitypub/security/index.js b/backend/src/activitypub/security/index.js index 05642ed26..9e0a63d22 100644 --- a/backend/src/activitypub/security/index.js +++ b/backend/src/activitypub/security/index.js @@ -51,7 +51,7 @@ export function createSignature(options) { // verifying export function verifySignature(url, headers) { return new Promise((resolve, reject) => { - const signatureHeader = headers['signature'] ? headers['signature'] : headers['Signature'] + const signatureHeader = headers.signature ? headers.signature : headers.Signature if (!signatureHeader) { debug('No Signature header present!') resolve(false)