From: David Kalnischkies Date: Mon, 17 Oct 2022 14:46:39 +0000 (+0200) Subject: Use application/json instead of text/x-json as mimetype X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b881ca6e1d15db012f3470b5412241273a0ebdfe;p=thirdparty%2Ftvheadend.git Use application/json instead of text/x-json as mimetype 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. --- diff --git a/src/webui/comet.c b/src/webui/comet.c index 5e0ff26ec..2e124de15 100644 --- a/src/webui/comet.c +++ b/src/webui/comet.c @@ -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; } diff --git a/src/webui/webui_api.c b/src/webui/webui_api.c index 299c2f773..718fbcce7 100644 --- a/src/webui/webui_api.c +++ b/src/webui/webui_api.c @@ -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); }