]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Use application/json instead of text/x-json as mimetype
authorDavid Kalnischkies <david@kalnischkies.de>
Mon, 17 Oct 2022 14:46:39 +0000 (16:46 +0200)
committerFlole998 <Flole998@users.noreply.github.com>
Mon, 21 Nov 2022 01:33:44 +0000 (02:33 +0100)
The web has mostly agreed on this standardized mimetype and e.g.
trying to open an API URI with Firefox is now opened in its friendly
JSON viewer rather than downloaded.

src/webui/comet.c
src/webui/webui_api.c

index 5e0ff26ecd1b546e8b6ef0215fb41e504e136246..2e124de152aabcf50e58daa5e56fa8cf74b0cb54 100644 (file)
@@ -347,7 +347,7 @@ comet_mailbox_poll(http_connection_t *hc, const char *remain, void *opaque)
 
   htsmsg_json_serialize(m, &hc->hc_reply, 0);
   htsmsg_destroy(m);
-  http_output_content(hc, "text/x-json; charset=UTF-8");
+  http_output_content(hc, "application/json; charset=UTF-8");
   return 0;
 }
 
index 299c2f7734c81085ab652607b61cefca5b6a96ef..718fbcce749d074b82444ea1c5d34fbfd77faadf 100644 (file)
@@ -75,7 +75,7 @@ destroy_args:
     resp = htsmsg_create_map();
   if (resp) {
     htsmsg_json_serialize(resp, &hc->hc_reply, 0);
-    http_output_content(hc, "text/x-json; charset=UTF-8");
+    http_output_content(hc, "application/json; charset=UTF-8");
     htsmsg_destroy(resp);
   }