From 63c92bbef932b831de7741ecc45c21915bfda82a Mon Sep 17 00:00:00 2001 From: "Schanzenbach, Martin" Date: Sat, 9 May 2020 20:55:08 +0200 Subject: add json response headers to rest plugins --- src/peerinfo-tool/plugin_rest_peerinfo.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/peerinfo-tool/plugin_rest_peerinfo.c') diff --git a/src/peerinfo-tool/plugin_rest_peerinfo.c b/src/peerinfo-tool/plugin_rest_peerinfo.c index 6e156569a..514b14313 100644 --- a/src/peerinfo-tool/plugin_rest_peerinfo.c +++ b/src/peerinfo-tool/plugin_rest_peerinfo.c @@ -326,6 +326,7 @@ do_error (void *cls) handle->response_code = MHD_HTTP_OK; response = json_dumps (json_error, 0); resp = GNUNET_REST_create_response (response); + MHD_add_response_header (resp, "Content-Type", "application/json"); handle->proc (handle->proc_cls, resp, handle->response_code); json_decref (json_error); GNUNET_free (response); @@ -356,6 +357,7 @@ peerinfo_list_finished (void *cls) result_str = json_dumps (handle->response, 0); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Result %s\n", result_str); resp = GNUNET_REST_create_response (result_str); + MHD_add_response_header (resp, "Content-Type", "application/json"); handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); GNUNET_free_non_null (result_str); GNUNET_SCHEDULER_add_now (&cleanup_handle, handle); -- cgit v1.2.3