diff --git a/packages/backend/src/remote/activitypub/renderer/person.ts b/packages/backend/src/remote/activitypub/renderer/person.ts
index 1122a3a27..7905653a2 100644
--- a/packages/backend/src/remote/activitypub/renderer/person.ts
+++ b/packages/backend/src/remote/activitypub/renderer/person.ts
@@ -35,16 +35,17 @@ export async function renderPerson(user: ILocalUser) {
if (profile.fields) {
for (const field of profile.fields) {
+ if (field.value?.match(/^https?:\/\//)) {
+ const hasTrailingSlash = field.value.endsWith('/');
+ field.value = new URL(field.value).href;
+ if (field.value.endsWith('/') && !hasTrailingSlash) field.value = field.value.slice(0, -1);
+ field.value = `${field.value}`;
+ }
+
attachment.push({
type: "PropertyValue",
name: field.name,
- value: field.value?.match(/^https?:/)
- ? `${
- new URL(field.value).href
- }`
- : field.value,
+ value: field.value,
});
}
}