diff options
| author | 2024-01-26 15:40:19 +0000 | |
|---|---|---|
| committer | 2024-01-26 15:40:19 +0000 | |
| commit | 1060baa6ca31f53fdfe54d44a4d6eabbff87eb5c (patch) | |
| tree | 7799617613bf4a83ec66e51606115d4ba600fc05 /httpd.c | |
| parent | Updated README. (diff) | |
| download | snac2-1060baa6ca31f53fdfe54d44a4d6eabbff87eb5c.tar.gz snac2-1060baa6ca31f53fdfe54d44a4d6eabbff87eb5c.tar.xz snac2-1060baa6ca31f53fdfe54d44a4d6eabbff87eb5c.zip | |
added host-meta endpoint for subwaytooter app
Diffstat (limited to 'httpd.c')
| -rw-r--r-- | httpd.c | 8 |
1 files changed, 8 insertions, 0 deletions
| @@ -235,6 +235,14 @@ int server_get_handler(xs_dict *req, const char *q_path, | |||
| 235 | *body = xs_str_new("User-agent: *\n" | 235 | *body = xs_str_new("User-agent: *\n" |
| 236 | "Disallow: /\n"); | 236 | "Disallow: /\n"); |
| 237 | } | 237 | } |
| 238 | else | ||
| 239 | if (strcmp(q_path, "/.well-known/host-meta") == 0) { | ||
| 240 | status = 200; | ||
| 241 | *ctype = "application/xrd+xml"; | ||
| 242 | *body = xs_str_new("<XRD>" | ||
| 243 | "<Link rel=\"lrdd\" type=\"application/xrd+xml\" template=\"%s/.well-known/webfinger?resource={uri}\"/>" | ||
| 244 | "</XRD>"); | ||
| 245 | } | ||
| 238 | 246 | ||
| 239 | if (status != 0) | 247 | if (status != 0) |
| 240 | srv_debug(1, xs_fmt("server_get_handler serving '%s' %d", q_path, status)); | 248 | srv_debug(1, xs_fmt("server_get_handler serving '%s' %d", q_path, status)); |