Avoid indexing of darkstat pages.
authorMalte S. Stretz <mss@apache.org>
Wed, 1 Sep 2010 11:48:28 +0000 (13:48 +0200)
committerEmil Mikulic <emikulic@gmail.com>
Sat, 28 May 2011 10:10:53 +0000 (20:10 +1000)
The data displayed by darkstat is probably not something which you want
to appear on Google and friends.  Just have a try:
    http://www.google.com/search?q=intitle:darkstat+inurl:666
    http://www.google.com/search?q=intitle:darkstat+inurl:667

html.c
http.c

diff --git a/html.c b/html.c
index 94631e1..4650353 100644 (file)
--- a/html.c
+++ b/html.c
@@ -23,6 +23,7 @@ void html_open(struct str *buf, const char *title, const char *interface,
     str_appendf(buf, "<title>%s (darkstat3 : %s)</title>\n"
         "<meta name=\"generator\" content=\"%s\" />\n", title, interface,
         PACKAGE_STRING);
+    str_append(buf, "<meta name=\"robots\" content=\"noindex, noarchive\" />\n");
     str_appendf(buf, "<link rel=\"stylesheet\" href=\"%s%s\" type=\"text/css\"/>\n",
         base_url, "style.css");
     if (header_callback != NULL)
diff --git a/http.c b/http.c
index 0c9b141..08b6bf7 100644 (file)
--- a/http.c
+++ b/http.c
@@ -384,6 +384,7 @@ static void generate_header(struct connection *conn,
         "Content-Type: %s\r\n"
         "Content-Length: %d\r\n"
         "Content-Encoding: %s\r\n"
+        "X-Robots-Tag: noindex, noarchive\r\n"
         "%s"
         "\r\n"
         ,