aboutsummaryrefslogtreecommitdiff
path: root/src/peerinfo-tool
diff options
context:
space:
mode:
authorSchanzenbach, Martin <mschanzenbach@posteo.de>2020-05-09 20:55:08 +0200
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2020-05-09 20:55:08 +0200
commit63c92bbef932b831de7741ecc45c21915bfda82a (patch)
tree9de65a8bfc8e86215e29d0b09f6546b3f1db2cfc /src/peerinfo-tool
parentd528c78ecfa75878e1bb4ea605bcafbbb2e63371 (diff)
downloadgnunet-63c92bbef932b831de7741ecc45c21915bfda82a.tar.gz
gnunet-63c92bbef932b831de7741ecc45c21915bfda82a.zip
add json response headers to rest plugins
Diffstat (limited to 'src/peerinfo-tool')
-rw-r--r--src/peerinfo-tool/plugin_rest_peerinfo.c2
1 files changed, 2 insertions, 0 deletions
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)
326 handle->response_code = MHD_HTTP_OK; 326 handle->response_code = MHD_HTTP_OK;
327 response = json_dumps (json_error, 0); 327 response = json_dumps (json_error, 0);
328 resp = GNUNET_REST_create_response (response); 328 resp = GNUNET_REST_create_response (response);
329 MHD_add_response_header (resp, "Content-Type", "application/json");
329 handle->proc (handle->proc_cls, resp, handle->response_code); 330 handle->proc (handle->proc_cls, resp, handle->response_code);
330 json_decref (json_error); 331 json_decref (json_error);
331 GNUNET_free (response); 332 GNUNET_free (response);
@@ -356,6 +357,7 @@ peerinfo_list_finished (void *cls)
356 result_str = json_dumps (handle->response, 0); 357 result_str = json_dumps (handle->response, 0);
357 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Result %s\n", result_str); 358 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Result %s\n", result_str);
358 resp = GNUNET_REST_create_response (result_str); 359 resp = GNUNET_REST_create_response (result_str);
360 MHD_add_response_header (resp, "Content-Type", "application/json");
359 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); 361 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK);
360 GNUNET_free_non_null (result_str); 362 GNUNET_free_non_null (result_str);
361 GNUNET_SCHEDULER_add_now (&cleanup_handle, handle); 363 GNUNET_SCHEDULER_add_now (&cleanup_handle, handle);