Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing content types #89

Merged
merged 2 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/server/api/followers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const followerRoutes = (cfg: APIConfig, store: Store, apsystem: ActivityP

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

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

// Remove a follower (notifying their server), use URL encoded URL of follower Actor
Expand Down
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)
})
}
Loading