diff options
| author | 2022-12-13 09:19:51 +0100 | |
|---|---|---|
| committer | 2022-12-13 09:19:51 +0100 | |
| commit | 56ce91eea0258f370359bcb813c292a2e096b2ae (patch) | |
| tree | d58a60a1deee65d51609d7159141179e629975aa /httpd.c | |
| parent | Updated RELEASE_NOTES. (diff) | |
| parent | Merge pull request 'Serve robots.txt (disallow all)' (#23) from kensanata/sna... (diff) | |
| download | snac2-56ce91eea0258f370359bcb813c292a2e096b2ae.tar.gz snac2-56ce91eea0258f370359bcb813c292a2e096b2ae.tar.xz snac2-56ce91eea0258f370359bcb813c292a2e096b2ae.zip | |
Merge branch 'master' of grunfink-codeberg:grunfink/snac2
Diffstat (limited to 'httpd.c')
| -rw-r--r-- | httpd.c | 7 |
1 files changed, 7 insertions, 0 deletions
| @@ -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)); |