diff options
author | Peter Palfrader <peter@palfrader.org> | 2006-03-27 07:33:13 +0000 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2006-03-27 07:33:13 +0000 |
commit | 03302dc67d6035cf655d1f47d3f78726a9e49826 (patch) | |
tree | 341206aef65f2c44585ef3db06592e20716e8612 | |
parent | 24217248539688ecb166cb08ef9417b9630b310f (diff) | |
download | tor-03302dc67d6035cf655d1f47d3f78726a9e49826.tar tor-03302dc67d6035cf655d1f47d3f78726a9e49826.tar.gz |
On our dirport return a robots.txt so maybe google doesn't index all those server descriptors anymore
svn:r6252
-rw-r--r-- | src/or/directory.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index 9a63ad2b1..f54cdb86a 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -1613,6 +1613,22 @@ directory_handle_command_get(connection_t *conn, char *headers, return 0; } + if (!strcmp(url,"/tor/robots.txt")) { /* /robots.txt will have been + rewritten to /tor/robots.txt */ + char robots[] = "User-agent: *\r\nDisallow: /\r\n"; + size_t len = strlen(robots); + format_rfc1123_time(date, time(NULL)); + tor_snprintf(tmp, sizeof(tmp), + "HTTP/1.0 200 OK\r\nDate: %s\r\nContent-Length: %d\r\n" + "Content-Type: text/plain\r\n\r\n", + date, + (int)len); + connection_write_to_buf(tmp, strlen(tmp), conn); + connection_write_to_buf(robots, len, conn); + tor_free(url); + return 0; + } + /* we didn't recognize the url */ write_http_status_line(conn, 404, "Not found"); tor_free(url); |