gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r35387 - in gnunet/src: identity rest
Date: Fri, 13 Mar 2015 18:37:07 +0100

Author: schanzen
Date: 2015-03-13 18:37:07 +0100 (Fri, 13 Mar 2015)
New Revision: 35387

Modified:
   gnunet/src/identity/plugin_rest_identity.c
   gnunet/src/rest/gnunet-rest-server.c
Log:
-fix, debug

Modified: gnunet/src/identity/plugin_rest_identity.c
===================================================================
--- gnunet/src/identity/plugin_rest_identity.c  2015-03-13 15:33:47 UTC (rev 
35386)
+++ gnunet/src/identity/plugin_rest_identity.c  2015-03-13 17:37:07 UTC (rev 
35387)
@@ -395,7 +395,6 @@
     GNUNET_free (keystring);
     if (NULL == egoname)
     {
-      GNUNET_break (0);
       json_array_append (ego_arr, ego_json);
       json_decref (ego_json);
     }
@@ -403,9 +402,9 @@
       break;
   }
   if (NULL == egoname)
-    json_object_set (root_json, JSON_API_TYPE_DATA, ego_arr);
+    json_object_set (root_json, "egos", ego_arr);
   else
-    json_object_set (root_json, JSON_API_TYPE_DATA, ego_json);
+    json_object_set (root_json, "ego", ego_json);
 
   result_str = json_dumps (root_json, JSON_COMPACT);
   json_decref (ego_arr);

Modified: gnunet/src/rest/gnunet-rest-server.c
===================================================================
--- gnunet/src/rest/gnunet-rest-server.c        2015-03-13 15:33:47 UTC (rev 
35386)
+++ gnunet/src/rest/gnunet-rest-server.c        2015-03-13 17:37:07 UTC (rev 
35387)
@@ -333,16 +333,12 @@
 
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Queueing response from plugin with MHD\n");
-    if (GNUNET_OK == con_handle->status) {
-      return MHD_queue_response (con,
-                                 MHD_HTTP_OK,
+    MHD_add_response_header 
(con_handle->response,"Access-Control-Allow-Origin","*");
+    int ret = MHD_queue_response (con,
+                                 con_handle->status,
                                  con_handle->response);
-    } else {
-      return MHD_queue_response (con,
-                                 MHD_HTTP_BAD_REQUEST,
-                                 con_handle->response);
-    }
     cleanup_handle (con_handle);
+    return ret;
   }
   return MHD_YES;
 }




reply via email to

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