diff options
-rw-r--r-- | src/identity/plugin_rest_identity.c | 3 | ||||
-rw-r--r-- | src/jsonapi/jsonapi_resource.c | 2 | ||||
-rw-r--r-- | src/rest/gnunet-rest-server.c | 4 |
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); |