diff --git a/backend/package.json b/backend/package.json index 117c14830..e9f6a92b7 100644 --- a/backend/package.json +++ b/backend/package.json @@ -116,7 +116,7 @@ "cucumber": "~5.1.0", "eslint": "~6.2.0", "eslint-config-prettier": "~6.1.0", - "eslint-config-standard": "~13.0.1", + "eslint-config-standard": "~14.0.0", "eslint-plugin-import": "~2.18.2", "eslint-plugin-jest": "~22.15.1", "eslint-plugin-node": "~9.1.0", 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) diff --git a/backend/yarn.lock b/backend/yarn.lock index f75f70a8c..33a159604 100644 --- a/backend/yarn.lock +++ b/backend/yarn.lock @@ -3274,10 +3274,10 @@ eslint-config-prettier@~6.1.0: dependencies: get-stdin "^6.0.0" -eslint-config-standard@~13.0.1: - version "13.0.1" - resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-13.0.1.tgz#c9c6ffe0cfb8a51535bc5c7ec9f70eafb8c6b2c0" - integrity sha512-zLKp4QOgq6JFgRm1dDCVv1Iu0P5uZ4v5Wa4DTOkg2RFMxdCX/9Qf7lz9ezRj2dBRa955cWQF/O/LWEiYWAHbTw== +eslint-config-standard@~14.0.0: + version "14.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-14.0.0.tgz#1de7bf5af37542dc6eef879ab7eb5e5e0f830747" + integrity sha512-bV6e2LFvJEetrLjVAy4KWPOUsIhPWr040c649MigTPR6yUtaGuOt6CEAyNeez2lRiC+2+vjGWa02byjs25EB3A== eslint-import-resolver-node@^0.3.2: version "0.3.2"