summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authorGravatar default2022-09-26 12:29:26 +0200
committerGravatar default2022-09-26 12:29:26 +0200
commit8f738e1417958a5e26fd8bfdf30fa4a166c0075a (patch)
tree250bc6eb1be95b1f9e031a8a79c62098ac6c2590 /activitypub.c
parentAdded direction to srv_archive() files. (diff)
downloadsnac2-8f738e1417958a5e26fd8bfdf30fa4a166c0075a.tar.gz
snac2-8f738e1417958a5e26fd8bfdf30fa4a166c0075a.tar.xz
snac2-8f738e1417958a5e26fd8bfdf30fa4a166c0075a.zip
Serve the actor as the correct content-type.
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c4
1 files changed, 3 insertions, 1 deletions
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,
506 506
507 p_path = xs_list_get(l, 2); 507 p_path = xs_list_get(l, 2);
508 508
509 *ctype = "application/activity+json";
510
509 if (p_path == NULL) { 511 if (p_path == NULL) {
510 /* if there was no component after the user, it's an actor request */ 512 /* if there was no component after the user, it's an actor request */
511 msg = msg_actor(&snac); 513 msg = msg_actor(&snac);
514 *ctype = "application/ld+json";
512 } 515 }
513 else 516 else
514 if (strcmp(p_path, "outbox") == 0) { 517 if (strcmp(p_path, "outbox") == 0) {
@@ -532,7 +535,6 @@ int activitypub_get_handler(d_char *req, char *q_path,
532 if (status == 200 && msg != NULL) { 535 if (status == 200 && msg != NULL) {
533 *body = xs_json_dumps_pp(msg, 4); 536 *body = xs_json_dumps_pp(msg, 4);
534 *b_size = strlen(*body); 537 *b_size = strlen(*body);
535 *ctype = "application/activity+json";
536 } 538 }
537 539
538 user_free(&snac); 540 user_free(&snac);