gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated: do not log full body if response has wro


From: gnunet
Subject: [gnunet] branch master updated: do not log full body if response has wrog mime type
Date: Fri, 22 Sep 2023 13:08:02 +0200

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

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 1709cc9e9 do not log full body if response has wrog mime type
1709cc9e9 is described below

commit 1709cc9e9fe49e2392b400a4cfaf8ac8a4146db3
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Sep 22 13:07:51 2023 +0200

    do not log full body if response has wrog mime type
---
 src/curl/curl.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/curl/curl.c b/src/curl/curl.c
index bb935d183..648c9a14e 100644
--- a/src/curl/curl.c
+++ b/src/curl/curl.c
@@ -669,6 +669,8 @@ GNUNET_CURL_download_get_result_ (struct 
GNUNET_CURL_DownloadBuffer *db,
     GNUNET_break (0);
     *response_code = 0;
   }
+  if (MHD_HTTP_NO_CONTENT == *response_code)
+    return NULL;
   if ((CURLE_OK !=
        curl_easy_getinfo (eh,
                           CURLINFO_CONTENT_TYPE,
@@ -680,14 +682,20 @@ GNUNET_CURL_download_get_result_ (struct 
GNUNET_CURL_DownloadBuffer *db,
        (but keep response code) */
     if (0 != db->buf_size)
     {
+      char *url;
+
+      if (CURLE_OK !=
+          curl_easy_getinfo (eh,
+                             CURLINFO_EFFECTIVE_URL,
+                             &url))
+        url = "<unknown URL>";
       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                  "Expected content type was `application/json', got `%s'\n",
+                  "Request to `%s' was expected to return a body of type 
`application/json', got `%s'\n",
+                  url,
                   ct);
     }
     return NULL;
   }
-  if (MHD_HTTP_NO_CONTENT == *response_code)
-    return NULL;
   if (0 == *response_code)
   {
     char *url;

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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