From 8f738e1417958a5e26fd8bfdf30fa4a166c0075a Mon Sep 17 00:00:00 2001 From: default Date: Mon, 26 Sep 2022 12:29:26 +0200 Subject: Serve the actor as the correct content-type. --- activitypub.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'activitypub.c') diff --git a/activitypub.c b/activitypub.c index 2e11a82..d792ce2 100644 --- a/activitypub.c +++ b/activitypub.c @@ -506,9 +506,12 @@ int activitypub_get_handler(d_char *req, char *q_path, p_path = xs_list_get(l, 2); + *ctype = "application/activity+json"; + if (p_path == NULL) { /* if there was no component after the user, it's an actor request */ msg = msg_actor(&snac); + *ctype = "application/ld+json"; } else if (strcmp(p_path, "outbox") == 0) { @@ -532,7 +535,6 @@ int activitypub_get_handler(d_char *req, char *q_path, if (status == 200 && msg != NULL) { *body = xs_json_dumps_pp(msg, 4); *b_size = strlen(*body); - *ctype = "application/activity+json"; } user_free(&snac); -- cgit v1.2.3