fix: normalize aliasUrl to absolute URL before storing alsoKnownAs

Without https://, jsonld rejects the value as a relative object
reference during signature verification, breaking Mastodon migration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
svemagie
2026-03-13 08:24:41 +01:00
parent a5223437b8
commit 0acd324070
+5 -1
View File
@@ -42,7 +42,11 @@ export function migratePostController(mountPath, pluginOptions) {
const profileCollection = application?.collections?.get("ap_profile");
let result = null;
const aliasUrl = request.body.aliasUrl?.trim();
let aliasUrl = request.body.aliasUrl?.trim();
// Ensure aliasUrl is an absolute URL — prepend https:// if missing scheme
if (aliasUrl && !/^https?:\/\//i.test(aliasUrl)) {
aliasUrl = `https://${aliasUrl}`;
}
const submittedAliasField = Object.prototype.hasOwnProperty.call(
request.body || {},
"aliasUrl",