Skip to content

Commit

Permalink
fix: inbox and outbox content types
Browse files Browse the repository at this point in the history
  • Loading branch information
fauno committed Oct 24, 2024
1 parent 5a7ef6d commit eaa1315
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/server/api/inbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const inboxRoutes = (cfg: APIConfig, store: Store, apsystem: ActivityPubS
id: `${cfg.publicURL}${request.url}`,
first: `${cfg.publicURL}/v1/${actor}/inbox?limit=100`
}
return await reply.send(inbox)
return await reply.headers({ 'Content-Type': 'application/activity+json' }).send(inbox)
}
skip ??= 0

Expand All @@ -68,7 +68,7 @@ export const inboxRoutes = (cfg: APIConfig, store: Store, apsystem: ActivityPubS
next,
orderedItems
}
return await reply.send(orderedCollectionPage)
return await reply.headers({ 'Content-Type': 'application/activity+json' }).send(orderedCollectionPage)
})

// This is what instances will POST to in order to notify of follows/replies/etc
Expand Down Expand Up @@ -145,7 +145,7 @@ export const inboxRoutes = (cfg: APIConfig, store: Store, apsystem: ActivityPubS

const collection = await apsystem.repliesCollection(actor, replyURL, to)

return await reply.send(collection)
return await reply.headers({ 'Content-Type': 'application/activity+json' }).send(collection)
})

// TODO: Paging?
Expand Down Expand Up @@ -179,7 +179,7 @@ export const inboxRoutes = (cfg: APIConfig, store: Store, apsystem: ActivityPubS

const collection = await apsystem.likesCollection(actor, objectURL, !allowed)

return await reply.send(collection)
return await reply.headers({ 'Content-Type': 'application/activity+json' }).send(collection)
})

// TODO: Paging?
Expand Down Expand Up @@ -213,7 +213,7 @@ export const inboxRoutes = (cfg: APIConfig, store: Store, apsystem: ActivityPubS

const collection = await apsystem.sharesCollection(actor, objectURL, !allowed)

return await reply.send(collection)
return await reply.headers({ 'Content-Type': 'application/activity+json' }).send(collection)
})
// Deny a follow request/boost/etc
// The ID is the URL encoded id from the inbox activity
Expand Down
2 changes: 1 addition & 1 deletion src/server/api/outbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ export const outboxRoutes = (cfg: APIConfig, store: Store, apsystem: ActivityPub

const activity = await apsystem.getOutboxItem(actor, id)

return await reply.send(activity)
return await reply.headers({ 'Content-Type': 'application/activity+json' }).send(activity)
})
}

0 comments on commit eaa1315

Please sign in to comment.