aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2016-06-18 19:31:00 +0000
committerMartin Schanzenbach <mschanzenbach@posteo.de>2016-06-18 19:31:00 +0000
commit229e7fbe49b1a1ab7121a57af6e241500c09c1bf (patch)
tree79c3c3c2622332230dcccd084f83e3da3625354b
parent710e8923105dfcc38d8aefed19e6da670db9c440 (diff)
downloadgnunet-229e7fbe49b1a1ab7121a57af6e241500c09c1bf.tar.gz
gnunet-229e7fbe49b1a1ab7121a57af6e241500c09c1bf.zip
- fix more rest and jsonapi
-rw-r--r--src/identity/plugin_rest_identity.c3
-rw-r--r--src/jsonapi/jsonapi_resource.c2
-rw-r--r--src/rest/gnunet-rest-server.c4
3 files changed, 8 insertions, 1 deletions
diff --git a/src/identity/plugin_rest_identity.c b/src/identity/plugin_rest_identity.c
index 44e754e6c..6cd2b685c 100644
--- a/src/identity/plugin_rest_identity.c
+++ b/src/identity/plugin_rest_identity.c
@@ -427,6 +427,9 @@ ego_info_response (struct GNUNET_REST_RequestHandle *con,
427 continue; 427 continue;
428 json_resource = GNUNET_JSONAPI_resource_new (GNUNET_REST_JSONAPI_IDENTITY_EGO, 428 json_resource = GNUNET_JSONAPI_resource_new (GNUNET_REST_JSONAPI_IDENTITY_EGO,
429 ego_entry->keystring); 429 ego_entry->keystring);
430 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
431 "Egoname: %s\n",
432 ego_entry->identifier);
430 name_str = json_string (ego_entry->identifier); 433 name_str = json_string (ego_entry->identifier);
431 GNUNET_JSONAPI_resource_add_attr ( 434 GNUNET_JSONAPI_resource_add_attr (
432 json_resource, 435 json_resource,
diff --git a/src/jsonapi/jsonapi_resource.c b/src/jsonapi/jsonapi_resource.c
index d1d811482..09217279a 100644
--- a/src/jsonapi/jsonapi_resource.c
+++ b/src/jsonapi/jsonapi_resource.c
@@ -145,7 +145,7 @@ GNUNET_JSONAPI_resource_add_attr (struct GNUNET_JSONAPI_Resource *resource,
145 return GNUNET_SYSERR; 145 return GNUNET_SYSERR;
146 if (NULL == resource->attr_obj) 146 if (NULL == resource->attr_obj)
147 resource->attr_obj = json_object (); 147 resource->attr_obj = json_object ();
148 json_object_set_new (resource->attr_obj, key, json); 148 json_object_set (resource->attr_obj, key, json);
149 return GNUNET_OK; 149 return GNUNET_OK;
150} 150}
151 151
diff --git a/src/rest/gnunet-rest-server.c b/src/rest/gnunet-rest-server.c
index fa17954b4..b115deb20 100644
--- a/src/rest/gnunet-rest-server.c
+++ b/src/rest/gnunet-rest-server.c
@@ -346,6 +346,10 @@ create_response (void *cls,
346 "Access-Control-Allow-Headers", 346 "Access-Control-Allow-Headers",
347 allow_headers); 347 allow_headers);
348 } 348 }
349 //Always add JSONAPI content type. TODO
350 MHD_add_response_header (con_handle->response,
351 MHD_HTTP_HEADER_CONTENT_TYPE,
352 "application/vnd.api+json");
349 int ret = MHD_queue_response (con, 353 int ret = MHD_queue_response (con,
350 con_handle->status, 354 con_handle->status,
351 con_handle->response); 355 con_handle->response);