diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2015-03-13 17:37:07 +0000 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2015-03-13 17:37:07 +0000 |
commit | 14f993de57d834b4743d22cd952cfd7ca3aef097 (patch) | |
tree | dd3516cfeab8d94e9812594846aecd0565455c82 /src | |
parent | 7ae2282ee296b24e0132d155ece49ae87e21215b (diff) | |
download | gnunet-14f993de57d834b4743d22cd952cfd7ca3aef097.tar.gz gnunet-14f993de57d834b4743d22cd952cfd7ca3aef097.zip |
-fix, debug
Diffstat (limited to 'src')
-rw-r--r-- | src/identity/plugin_rest_identity.c | 5 | ||||
-rw-r--r-- | src/rest/gnunet-rest-server.c | 12 |
2 files changed, 6 insertions, 11 deletions
diff --git a/src/identity/plugin_rest_identity.c b/src/identity/plugin_rest_identity.c index 60d6547d5..1bc5f6fea 100644 --- a/src/identity/plugin_rest_identity.c +++ b/src/identity/plugin_rest_identity.c | |||
@@ -395,7 +395,6 @@ ego_info_response (struct RequestHandle *handle) | |||
395 | GNUNET_free (keystring); | 395 | GNUNET_free (keystring); |
396 | if (NULL == egoname) | 396 | if (NULL == egoname) |
397 | { | 397 | { |
398 | GNUNET_break (0); | ||
399 | json_array_append (ego_arr, ego_json); | 398 | json_array_append (ego_arr, ego_json); |
400 | json_decref (ego_json); | 399 | json_decref (ego_json); |
401 | } | 400 | } |
@@ -403,9 +402,9 @@ ego_info_response (struct RequestHandle *handle) | |||
403 | break; | 402 | break; |
404 | } | 403 | } |
405 | if (NULL == egoname) | 404 | if (NULL == egoname) |
406 | json_object_set (root_json, JSON_API_TYPE_DATA, ego_arr); | 405 | json_object_set (root_json, "egos", ego_arr); |
407 | else | 406 | else |
408 | json_object_set (root_json, JSON_API_TYPE_DATA, ego_json); | 407 | json_object_set (root_json, "ego", ego_json); |
409 | 408 | ||
410 | result_str = json_dumps (root_json, JSON_COMPACT); | 409 | result_str = json_dumps (root_json, JSON_COMPACT); |
411 | json_decref (ego_arr); | 410 | json_decref (ego_arr); |
diff --git a/src/rest/gnunet-rest-server.c b/src/rest/gnunet-rest-server.c index 1a6ab73b0..10577b451 100644 --- a/src/rest/gnunet-rest-server.c +++ b/src/rest/gnunet-rest-server.c | |||
@@ -333,16 +333,12 @@ create_response (void *cls, | |||
333 | 333 | ||
334 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 334 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
335 | "Queueing response from plugin with MHD\n"); | 335 | "Queueing response from plugin with MHD\n"); |
336 | if (GNUNET_OK == con_handle->status) { | 336 | MHD_add_response_header (con_handle->response,"Access-Control-Allow-Origin","*"); |
337 | return MHD_queue_response (con, | 337 | int ret = MHD_queue_response (con, |
338 | MHD_HTTP_OK, | 338 | con_handle->status, |
339 | con_handle->response); | 339 | con_handle->response); |
340 | } else { | ||
341 | return MHD_queue_response (con, | ||
342 | MHD_HTTP_BAD_REQUEST, | ||
343 | con_handle->response); | ||
344 | } | ||
345 | cleanup_handle (con_handle); | 340 | cleanup_handle (con_handle); |
341 | return ret; | ||
346 | } | 342 | } |
347 | return MHD_YES; | 343 | return MHD_YES; |
348 | } | 344 | } |