diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-05-09 20:55:08 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-05-09 20:55:08 +0200 |
commit | 63c92bbef932b831de7741ecc45c21915bfda82a (patch) | |
tree | 9de65a8bfc8e86215e29d0b09f6546b3f1db2cfc /src/gns | |
parent | d528c78ecfa75878e1bb4ea605bcafbbb2e63371 (diff) | |
download | gnunet-63c92bbef932b831de7741ecc45c21915bfda82a.tar.gz gnunet-63c92bbef932b831de7741ecc45c21915bfda82a.zip |
add json response headers to rest plugins
Diffstat (limited to 'src/gns')
-rw-r--r-- | src/gns/plugin_rest_gns.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gns/plugin_rest_gns.c b/src/gns/plugin_rest_gns.c index 81c2c974b..feb333350 100644 --- a/src/gns/plugin_rest_gns.c +++ b/src/gns/plugin_rest_gns.c | |||
@@ -200,6 +200,7 @@ do_error (void *cls) | |||
200 | handle->response_code = MHD_HTTP_INTERNAL_SERVER_ERROR; | 200 | handle->response_code = MHD_HTTP_INTERNAL_SERVER_ERROR; |
201 | response = json_dumps (json_error, 0); | 201 | response = json_dumps (json_error, 0); |
202 | resp = GNUNET_REST_create_response (response); | 202 | resp = GNUNET_REST_create_response (response); |
203 | MHD_add_response_header (resp, "Content-Type", "application/json"); | ||
203 | handle->proc (handle->proc_cls, resp, handle->response_code); | 204 | handle->proc (handle->proc_cls, resp, handle->response_code); |
204 | json_decref (json_error); | 205 | json_decref (json_error); |
205 | GNUNET_free (response); | 206 | GNUNET_free (response); |
@@ -252,6 +253,7 @@ handle_gns_response (void *cls, | |||
252 | result = json_dumps (result_obj, 0); | 253 | result = json_dumps (result_obj, 0); |
253 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Result %s\n", result); | 254 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Result %s\n", result); |
254 | resp = GNUNET_REST_create_response (result); | 255 | resp = GNUNET_REST_create_response (result); |
256 | MHD_add_response_header (resp, "Content-Type", "application/json"); | ||
255 | handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); | 257 | handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); |
256 | GNUNET_free (result); | 258 | GNUNET_free (result); |
257 | json_decref (result_obj); | 259 | json_decref (result_obj); |