jsoninfo: also send the (UTF-8) charset in the content type
authorFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 27 Nov 2015 15:04:21 +0000 (16:04 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Fri, 27 Nov 2015 16:10:01 +0000 (17:10 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/jsoninfo/src/olsrd_jsoninfo.c

index 783efaf..2ba7efc 100644 (file)
@@ -1197,7 +1197,7 @@ static void info_write_data(void *foo __attribute__ ((unused))) {
 static void send_info(unsigned int send_what, int the_socket) {
   struct autobuf abuf;
 
 static void send_info(unsigned int send_what, int the_socket) {
   struct autobuf abuf;
 
-  const char *content_type = (send_what & SIW_ALL) ? "application/json" : "text/plain";
+  const char *content_type = (send_what & SIW_ALL) ? "application/json; charset=utf-8" : "text/plain; charset=utf-8";
   int contentLengthPlaceholderStart = 0;
   int headerLength = 0;
 
   int contentLengthPlaceholderStart = 0;
   int headerLength = 0;