commit 99c3ec1

grunfink  ·  2022-12-13 08:18:58 +0000 UTC
parents 1eb5c7a, 63f02f4
Merge pull request 'Serve robots.txt (disallow all)' (#23) from kensanata/snac2:robots into master

Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/23
1 files changed,  +7, -0
+7, -0
 1@@ -117,6 +117,13 @@ int server_get_handler(d_char *req, char *q_path,
 2         *ctype = "application/json; charset=utf-8";
 3         *body  = nodeinfo_2_0();
 4     }
 5+    else
 6+    if (strcmp(q_path, "/robots.txt") == 0) {
 7+        status = 200;
 8+        *ctype = "text/plain";
 9+        *body  = "User-agent: *\n"
10+			"Disallow: /\n";
11+    }
12 
13     if (status != 0)
14         srv_debug(1, xs_fmt("server_get_handler serving '%s' %d", q_path, status));