jsoninfo: fix content type of http headers for /olsr.conf
authorFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 26 Nov 2015 19:14:44 +0000 (20:14 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 27 Nov 2015 09:17:23 +0000 (10:17 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/jsoninfo/src/olsrd_jsoninfo.c

index b9a1769..235ef47 100644 (file)
@@ -1359,7 +1359,7 @@ static void send_info(unsigned int send_what, int the_socket) {
   struct autobuf abuf;
   size_t header_len = 0;
   char header_buf[MAX_HTTPHEADER_SIZE];
   struct autobuf abuf;
   size_t header_len = 0;
   char header_buf[MAX_HTTPHEADER_SIZE];
-  const char *content_type = "application/json";
+  const char *content_type = (send_what & SIW_ALL) ? "application/json" : "text/plain";
 
   /* global variables for tracking when to put a comma in for JSON */
   entrynumber[0] = 0;
 
   /* global variables for tracking when to put a comma in for JSON */
   entrynumber[0] = 0;