snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 99c3ec1601caf6b34e098b39e0ae20c8fe4ce486
parent 1eb5c7a6e2f5436c8f0be77acc06672a5f24562a
Author: grunfink <grunfink@noreply.codeberg.org>
Date:   Tue, 13 Dec 2022 08:18:58 +0000

Merge pull request 'Serve robots.txt (disallow all)' (#23) from kensanata/snac2:robots into master

Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/23

Diffstat:
Mhttpd.c | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git 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));