summaryrefslogtreecommitdiff
path: root/httpd.c
diff options
context:
space:
mode:
authorGravatar grunfink2022-12-13 08:18:58 +0000
committerGravatar grunfink2022-12-13 08:18:58 +0000
commit99c3ec1601caf6b34e098b39e0ae20c8fe4ce486 (patch)
tree08703419ee4f59ddc95d714f1cb7a66854a499b0 /httpd.c
parentMerge pull request 'Add docker-compose support' (#22) from tobyjaffey/snac2:d... (diff)
parentServe robots.txt (disallow all) (diff)
downloadsnac2-99c3ec1601caf6b34e098b39e0ae20c8fe4ce486.tar.gz
snac2-99c3ec1601caf6b34e098b39e0ae20c8fe4ce486.tar.xz
snac2-99c3ec1601caf6b34e098b39e0ae20c8fe4ce486.zip
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 (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,
117 *ctype = "application/json; charset=utf-8"; 117 *ctype = "application/json; charset=utf-8";
118 *body = nodeinfo_2_0(); 118 *body = nodeinfo_2_0();
119 } 119 }
120 else
121 if (strcmp(q_path, "/robots.txt") == 0) {
122 status = 200;
123 *ctype = "text/plain";
124 *body = "User-agent: *\n"
125 "Disallow: /\n";
126 }
120 127
121 if (status != 0) 128 if (status != 0)
122 srv_debug(1, xs_fmt("server_get_handler serving '%s' %d", q_path, status)); 129 srv_debug(1, xs_fmt("server_get_handler serving '%s' %d", q_path, status));