From 58d329e3bd5d0a8b620a8f9716fed4006231c6b0 Mon Sep 17 00:00:00 2001 From: dakkar Date: Mon, 5 Aug 2024 10:12:27 +0100 Subject: [PATCH] make sure that `sensitive` is a boolean - fixes #596 Some remote instances may send garbage. If the `sensitive` value passed to `driveService.uploadFromUrl` is not a boolean, eventually we'll get an exception from the database complaining about that. This change avoids that problem. --- packages/backend/src/core/activitypub/models/ApImageService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/core/activitypub/models/ApImageService.ts b/packages/backend/src/core/activitypub/models/ApImageService.ts index 3d98c5b764..b281ac9728 100644 --- a/packages/backend/src/core/activitypub/models/ApImageService.ts +++ b/packages/backend/src/core/activitypub/models/ApImageService.ts @@ -82,7 +82,7 @@ export class ApImageService { url: image.url, user: actor, uri: image.url, - sensitive: image.sensitive, + sensitive: !!(image.sensitive), isLink: !shouldBeCached, comment: truncate(image.name ?? undefined, DB_MAX_IMAGE_COMMENT_LENGTH), });