summaryrefslogtreecommitdiff
path: root/httpd.c
diff options
context:
space:
mode:
authorPaul Wilde <paul@wilde.cloud>2024-01-26 16:42:20 +0000
committerPaul Wilde <paul@wilde.cloud>2024-01-26 16:42:20 +0000
commit2965f1ede4d2765c208748f3054aa61df5c48da7 (patch)
tree0fa030454da79a74143fc1725d381fb4166bd66a /httpd.c
parent7de892bd8318f049ef12f1950f39ff068f19e389 (diff)
added host-meta endpoint for subwaytooter app
Diffstat (limited to 'httpd.c')
-rw-r--r--httpd.c8
1 files changed, 8 insertions, 0 deletions
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("<XRD>"
+ "<Link rel=\"lrdd\" type=\"application/xrd+xml\" template=\"%s/.well-known/webfinger?resource={uri}\"/>"
+ "</XRD>");
+ }
+ else
if (strcmp(q_path, "/nodeinfo_2_0") == 0) {
status = 200;
*ctype = "application/json; charset=utf-8";