From be6778ac61e9020477fc8231da034a969b652920 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 15 Nov 2023 16:10:05 +0900 Subject: [PATCH] chore(backend): improve performance --- packages/backend/src/core/activitypub/ApRendererService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/core/activitypub/ApRendererService.ts b/packages/backend/src/core/activitypub/ApRendererService.ts index 49f9ebe3fb..1891c341e4 100644 --- a/packages/backend/src/core/activitypub/ApRendererService.ts +++ b/packages/backend/src/core/activitypub/ApRendererService.ts @@ -464,7 +464,7 @@ export class ApRendererService { const attachment = profile.fields.map(field => ({ type: 'PropertyValue', name: field.name, - value: /^https?:/.test(field.value) + value: (field.value.startsWith('http://') || field.value.startsWith('https://')) ? `${new URL(field.value).href}` : field.value, }));