mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-01-03 14:56:34 -05:00
Update: Added warning about JSON rendering
This commit is contained in:
parent
29dd621a08
commit
979c336b5b
@ -568,7 +568,7 @@ void admin_send_response(xmlDocPtr doc,
|
||||
}
|
||||
|
||||
json = xml2json_render_doc_simple(doc, ns);
|
||||
client_send_buffer(client, 200, "application/json", "utf-8", json, -1, NULL);
|
||||
client_send_buffer(client, 200, "application/json", "utf-8", json, -1, "Warning: 299 - \"JSON rendering is experimental\"\r\n");
|
||||
free(json);
|
||||
}
|
||||
} else if (response == ADMIN_FORMAT_HTML) {
|
||||
|
10
src/client.c
10
src/client.c
@ -704,14 +704,18 @@ void client_send_reportxml(client_t *client, reportxml_t *report, document_domai
|
||||
}
|
||||
|
||||
if (admin_format == ADMIN_FORMAT_RAW || admin_format == ADMIN_FORMAT_JSON) {
|
||||
char extra_header[512] = "";
|
||||
static const char json_warning[] = "Warning: 299 - \"JSON rendering is experimental\"\r\n";
|
||||
char extra_header_buffer[512] = "";
|
||||
const char *extra_header = extra_header_buffer;
|
||||
|
||||
if (location) {
|
||||
int res = snprintf(extra_header, sizeof(extra_header), "Location: %s\r\n", location);
|
||||
if (res < 0 || res >= (ssize_t)sizeof(extra_header)) {
|
||||
int res = snprintf(extra_header_buffer, sizeof(extra_header_buffer), "Location: %s\r\n%s", location, admin_format == ADMIN_FORMAT_JSON ? json_warning : "");
|
||||
if (res < 0 || res >= (ssize_t)sizeof(extra_header_buffer)) {
|
||||
client_send_error_by_id(client, ICECAST_ERROR_GEN_HEADER_GEN_FAILED);
|
||||
return;
|
||||
}
|
||||
} else if (admin_format == ADMIN_FORMAT_JSON) {
|
||||
extra_header = json_warning;
|
||||
}
|
||||
|
||||
if (admin_format == ADMIN_FORMAT_RAW) {
|
||||
|
Loading…
Reference in New Issue
Block a user