summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--activitypub.c4
-rw-r--r--http.c7
2 files changed, 8 insertions, 3 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);
diff --git a/http.c b/http.c
index 379080e..2a99c2b 100644
--- a/http.c
+++ b/http.c
@@ -81,8 +81,11 @@ d_char *http_signed_request(snac *snac, char *method, char *url,
81 hdrs = xs_dict_append(hdrs, k, v); 81 hdrs = xs_dict_append(hdrs, k, v);
82 82
83 /* add the new headers */ 83 /* add the new headers */
84 hdrs = xs_dict_append(hdrs, "content-type", "application/activity+json"); 84 if (strcmp(method, "POST") == 0)
85 hdrs = xs_dict_append(hdrs, "accept", "application/activity+json"); 85 hdrs = xs_dict_append(hdrs, "content-type", "application/activity+json");
86 else
87 hdrs = xs_dict_append(hdrs, "accept", "application/activity+json");
88
86 hdrs = xs_dict_append(hdrs, "date", date); 89 hdrs = xs_dict_append(hdrs, "date", date);
87 hdrs = xs_dict_append(hdrs, "signature", signature); 90 hdrs = xs_dict_append(hdrs, "signature", signature);
88 hdrs = xs_dict_append(hdrs, "digest", digest); 91 hdrs = xs_dict_append(hdrs, "digest", digest);