From 1060baa6ca31f53fdfe54d44a4d6eabbff87eb5c Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Fri, 26 Jan 2024 15:40:19 +0000 Subject: added host-meta endpoint for subwaytooter app --- httpd.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'httpd.c') diff --git a/httpd.c b/httpd.c index 0bdd9bc..b956dcb 100644 --- a/httpd.c +++ b/httpd.c @@ -235,6 +235,14 @@ int server_get_handler(xs_dict *req, const char *q_path, *body = xs_str_new("User-agent: *\n" "Disallow: /\n"); } + else + if (strcmp(q_path, "/.well-known/host-meta") == 0) { + status = 200; + *ctype = "application/xrd+xml"; + *body = xs_str_new("" + "" + ""); + } if (status != 0) srv_debug(1, xs_fmt("server_get_handler serving '%s' %d", q_path, status)); -- cgit From 2965f1ede4d2765c208748f3054aa61df5c48da7 Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Fri, 26 Jan 2024 16:42:20 +0000 Subject: added host-meta endpoint for subwaytooter app --- httpd.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'httpd.c') diff --git a/httpd.c b/httpd.c index 0bdd9bc..a20d692 100644 --- a/httpd.c +++ b/httpd.c @@ -223,6 +223,14 @@ int server_get_handler(xs_dict *req, const char *q_path, srv_baseurl); } else + if (strcmp(q_path, "/.well-known/host-meta") == 0) { + status = 200; + *ctype = "application/xrd+xml"; + *body = xs_str_new("" + "" + ""); + } + else if (strcmp(q_path, "/nodeinfo_2_0") == 0) { status = 200; *ctype = "application/json; charset=utf-8"; -- cgit From 9568ec8bfede731d2ecdc5840e3a8a125fc31510 Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Sun, 28 Jan 2024 21:04:11 +0000 Subject: cleanup --- httpd.c | 8 -------- mastoapi.c | 1 + 2 files changed, 1 insertion(+), 8 deletions(-) (limited to 'httpd.c') diff --git a/httpd.c b/httpd.c index 3a39481..a20d692 100644 --- a/httpd.c +++ b/httpd.c @@ -243,14 +243,6 @@ int server_get_handler(xs_dict *req, const char *q_path, *body = xs_str_new("User-agent: *\n" "Disallow: /\n"); } - else - if (strcmp(q_path, "/.well-known/host-meta") == 0) { - status = 200; - *ctype = "application/xrd+xml"; - *body = xs_str_new("" - "" - ""); - } if (status != 0) srv_debug(1, xs_fmt("server_get_handler serving '%s' %d", q_path, status)); diff --git a/mastoapi.c b/mastoapi.c index 6ed3835..8a48198 100644 --- a/mastoapi.c +++ b/mastoapi.c @@ -1414,6 +1414,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, const char *type = xs_dict_get(msg, "type"); if (!xs_match(type, "Note|Question|Page|Article")) continue; + const char *from = NULL; if (strcmp(type, "Page") == 0) from = xs_dict_get(msg, "audience"); -- cgit