Browse Source

In server_get_handler(), body must be a dynamic string.

default 2 years ago
parent
commit
a67a82d545
1 changed files with 2 additions and 2 deletions
  1. 2 2
      httpd.c

+ 2 - 2
httpd.c

@@ -121,8 +121,8 @@ int server_get_handler(d_char *req, char *q_path,
     if (strcmp(q_path, "/robots.txt") == 0) {
         status = 200;
         *ctype = "text/plain";
-        *body  = "User-agent: *\n"
-			"Disallow: /\n";
+        *body  = xs_str_new("User-agent: *\n"
+                            "Disallow: /\n");
     }
 
     if (status != 0)