aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/main.ml9
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/main.ml b/bin/main.ml
index 3a2e106..ef7d5fa 100644
--- a/bin/main.ml
+++ b/bin/main.ml
@@ -54,6 +54,8 @@ let actor =
}
|}
+let header_concat (a, b) = a ^ ": " ^ b
+
let () =
Post.add fake_post;
Post.add fake_post_2;
@@ -69,11 +71,11 @@ let () =
Dream.get "/actor" (fun _ ->
Dream.log "Sending actor";
Dream.respond actor
- ~headers:[ ("Content-Type", "application/json+ld") ]);
+ ~headers:[ ("Content-Type", "application/activity+json") ]);
Dream.get "/.well-known/webfinger" (fun _ ->
Dream.log "Sending webfinger";
Dream.respond webfinger
- ~headers:[ ("Content-Type", "application/json+ld") ]);
+ ~headers:[ ("Content-Type", "application/activity+json") ]);
Dream.get "/" (fun request ->
Dream.log "Sending greeting to %s!" (Dream.client request);
let posts = Post.get_all () in
@@ -81,6 +83,9 @@ let () =
Dream.post "/inbox" (fun request ->
let%lwt body = Dream.body request in
Dream.log "Got body: %s" body;
+ let headers = Dream.all_headers request in
+ Dream.log "Got headers: %s"
+ (String.concat " " (List.map header_concat headers));
let message_object =
Yojson.Safe.from_string body |> Post.mastodon_post_of_yojson
in