info: fix json Content-Type header
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 6 Dec 2016 15:43:16 +0000 (16:43 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 6 Dec 2016 15:57:13 +0000 (16:57 +0100)
To comply with http://jsonapi.org/format/

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/info.java/org.olsr.v1.info.proxy/testresources/sgw.json
lib/jsoninfo/src/olsrd_jsoninfo.c
lib/netjson/src/olsrd_netjson.c

index 8e4d89b..00d7e2b 100644 (file)
@@ -2,7 +2,7 @@ HTTP/1.1 200 OK
 Date: Mon, 07 Dec 2015 07:33:54 GMT
 Server: OLSRD JSONINFO
 Connection: close
-Content-Type: application/json; charset=utf-8
+Content-Type: application/vnd.api+json
 Access-Control-Allow-Origin: *
 Access-Control-Allow-Methods: GET, POST, OPTIONS
 Access-Control-Allow-Headers: Accept, Origin, X-Requested-With
index 3cdbeb2..c1859f6 100644 (file)
@@ -210,7 +210,7 @@ bool isCommand(const char *str, unsigned long long siw) {
 }
 
 const char * determine_mime_type(unsigned int send_what) {
-  return (send_what & SIW_OLSRD_CONF) ? "text/plain; charset=utf-8" : "application/json; charset=utf-8";
+  return (send_what & SIW_OLSRD_CONF) ? "text/plain; charset=utf-8" : "application/vnd.api+json";
 }
 
 void output_start(struct autobuf *abuf) {
index cea0b8b..15d5413 100644 (file)
@@ -90,7 +90,7 @@ bool isCommand(const char *str, unsigned long long siw) {
 }
 
 const char * determine_mime_type(unsigned int send_what __attribute__((unused))) {
-  return "application/json; charset=utf-8";
+  return "application/vnd.api+json";
 }
 
 void output_start(struct autobuf *abuf) {