gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-twister] branch master updated (6b94ed4 -> 5edfaa8)


From: gnunet
Subject: [GNUnet-SVN] [taler-twister] branch master updated (6b94ed4 -> 5edfaa8)
Date: Wed, 12 Jun 2019 22:16:45 +0200

This is an automated email from the git hooks/post-receive script.

marcello pushed a change to branch master
in repository twister.

    from 6b94ed4  fix 0% chaos rate
     new 411d8e6  remove useless code
     new 5edfaa8  check Content-Type before parsing

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/twister/taler-twister-service.c | 37 ++++++++++++++++++++++---------------
 1 file changed, 22 insertions(+), 15 deletions(-)

diff --git a/src/twister/taler-twister-service.c 
b/src/twister/taler-twister-service.c
index 0833e06..66b298e 100644
--- a/src/twister/taler-twister-service.c
+++ b/src/twister/taler-twister-service.c
@@ -1514,29 +1514,36 @@ create_response (void *cls,
     {
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "Attempting to decompress\n");
-      #if 1
       const char *ce;
       ce = MHD_lookup_connection_value
         (con,
          MHD_HEADER_KIND,
          MHD_HTTP_HEADER_CONTENT_ENCODING);
+
       if ((NULL != ce) && (0 == strcmp ("deflate", ce)))
         GNUNET_assert (Z_OK == inflate_data (hr));
-      #endif
-
-      json_error_t error;
-      hr->json = json_loadb (hr->io_buf,
-                             hr->io_len,
-                             JSON_DECODE_ANY,
-                             &error);
-      if (NULL == hr->json)
+
+      ce = MHD_lookup_connection_value
+        (con,
+         MHD_HEADER_KIND,
+         MHD_HTTP_HEADER_CONTENT_TYPE);
+
+      if ((NULL != ce) && (0 == strcmp ("application/json", ce)))
       {
-        TALER_LOG_ERROR
-          ("Could not parse JSON from client: %s (%s)\n",
-           error.text,
-           error.source);
-        /* Quick and dirty.  */
-        return MHD_NO;
+        json_error_t error;
+        hr->json = json_loadb (hr->io_buf,
+                               hr->io_len,
+                               JSON_DECODE_ANY,
+                               &error);
+        if (NULL == hr->json)
+        {
+          TALER_LOG_ERROR
+            ("Could not parse JSON from client: %s (%s)\n",
+             error.text,
+             error.source);
+          /* Quick and dirty.  */
+          return MHD_NO;
+        }
       }
     }
   }

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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