summaryrefslogtreecommitdiff
path: root/httpd.c
diff options
context:
space:
mode:
authorAlex Schroeder <alex@gnu.org>2022-12-12 22:11:07 +0100
committerAlex Schroeder <alex@gnu.org>2022-12-12 22:11:07 +0100
commit63f02f45c6bd517c8b7697475fa933627a06deeb (patch)
tree12f295f4f8a79e5a3d6a3ef7f9ec45c27b86fe47 /httpd.c
parentaa82e14bc7e7a3770feb23446d1a843d97213ccf (diff)
Serve robots.txt (disallow all)
Diffstat (limited to 'httpd.c')
-rw-r--r--httpd.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/httpd.c b/httpd.c
index ae49189..e05a0c2 100644
--- a/httpd.c
+++ b/httpd.c
@@ -117,6 +117,13 @@ int server_get_handler(d_char *req, char *q_path,
*ctype = "application/json; charset=utf-8";
*body = nodeinfo_2_0();
}
+ else
+ if (strcmp(q_path, "/robots.txt") == 0) {
+ status = 200;
+ *ctype = "text/plain";
+ *body = "User-agent: *\n"
+ "Disallow: /\n";
+ }
if (status != 0)
srv_debug(1, xs_fmt("server_get_handler serving '%s' %d", q_path, status));