瀏覽代碼

Merge branch 'master' of grunfink-codeberg:grunfink/snac2

default 3 年之前
父節點
當前提交
56ce91eea0
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      httpd.c

+ 7 - 0
httpd.c

@@ -117,6 +117,13 @@ int server_get_handler(d_char *req, char *q_path,
         *ctype = "application/json; charset=utf-8";
         *ctype = "application/json; charset=utf-8";
         *body  = nodeinfo_2_0();
         *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)
     if (status != 0)
         srv_debug(1, xs_fmt("server_get_handler serving '%s' %d", q_path, status));
         srv_debug(1, xs_fmt("server_get_handler serving '%s' %d", q_path, status));