gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r37275 - in gnunet/src: identity jsonapi rest


From: gnunet
Subject: [GNUnet-SVN] r37275 - in gnunet/src: identity jsonapi rest
Date: Sat, 18 Jun 2016 21:31:00 +0200

Author: schanzen
Date: 2016-06-18 21:31:00 +0200 (Sat, 18 Jun 2016)
New Revision: 37275

Modified:
   gnunet/src/identity/plugin_rest_identity.c
   gnunet/src/jsonapi/jsonapi_resource.c
   gnunet/src/rest/gnunet-rest-server.c
Log:
- fix more rest and jsonapi


Modified: gnunet/src/identity/plugin_rest_identity.c
===================================================================
--- gnunet/src/identity/plugin_rest_identity.c  2016-06-18 18:49:13 UTC (rev 
37274)
+++ gnunet/src/identity/plugin_rest_identity.c  2016-06-18 19:31:00 UTC (rev 
37275)
@@ -427,6 +427,9 @@
       continue;
     json_resource = GNUNET_JSONAPI_resource_new 
(GNUNET_REST_JSONAPI_IDENTITY_EGO,
                                                       ego_entry->keystring);
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                "Egoname: %s\n",
+                ego_entry->identifier);
     name_str = json_string (ego_entry->identifier);
     GNUNET_JSONAPI_resource_add_attr (
                                            json_resource,

Modified: gnunet/src/jsonapi/jsonapi_resource.c
===================================================================
--- gnunet/src/jsonapi/jsonapi_resource.c       2016-06-18 18:49:13 UTC (rev 
37274)
+++ gnunet/src/jsonapi/jsonapi_resource.c       2016-06-18 19:31:00 UTC (rev 
37275)
@@ -145,7 +145,7 @@
     return GNUNET_SYSERR;
   if (NULL == resource->attr_obj)
     resource->attr_obj = json_object ();
-  json_object_set_new (resource->attr_obj, key, json);
+  json_object_set (resource->attr_obj, key, json);
   return GNUNET_OK;
 }
 

Modified: gnunet/src/rest/gnunet-rest-server.c
===================================================================
--- gnunet/src/rest/gnunet-rest-server.c        2016-06-18 18:49:13 UTC (rev 
37274)
+++ gnunet/src/rest/gnunet-rest-server.c        2016-06-18 19:31:00 UTC (rev 
37275)
@@ -346,6 +346,10 @@
                                "Access-Control-Allow-Headers",
                                allow_headers);
     }
+    //Always add JSONAPI content type. TODO
+    MHD_add_response_header (con_handle->response,
+                             MHD_HTTP_HEADER_CONTENT_TYPE,
+                             "application/vnd.api+json");
     int ret = MHD_queue_response (con,
                                   con_handle->status,
                                   con_handle->response);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]