diff --git a/lib/controllers/profile.js b/lib/controllers/profile.js index d63a41c..6db58ba 100644 --- a/lib/controllers/profile.js +++ b/lib/controllers/profile.js @@ -50,9 +50,15 @@ export function profilePostController(mountPath, plugin) { authorizedFetch, } = request.body; - // Parse profile links (attachments) from form arrays - const linkNames = [].concat(request.body["link_name[]"] || []); - const linkValues = [].concat(request.body["link_value[]"] || []); + // Parse profile links (attachments) from form arrays. + // With express.urlencoded({ extended: true }), qs strips the [] + // suffix so the data arrives as request.body.link_name (array). + const linkNames = [].concat( + request.body.link_name || request.body["link_name[]"] || [], + ); + const linkValues = [].concat( + request.body.link_value || request.body["link_value[]"] || [], + ); const attachments = []; for (let i = 0; i < linkNames.length; i++) { const n = linkNames[i]?.trim(); diff --git a/package.json b/package.json index d11002b..a0a3995 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rmdes/indiekit-endpoint-activitypub", - "version": "1.1.7", + "version": "1.1.8", "description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.", "keywords": [ "indiekit",