gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: improve curl backwards compatibi


From: gnunet
Subject: [taler-merchant] branch master updated: improve curl backwards compatibility, de-duplicate code
Date: Mon, 08 Jan 2024 19:22:09 +0100

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

grothoff pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 84b7ef35 improve curl backwards compatibility, de-duplicate code
84b7ef35 is described below

commit 84b7ef357a50bafc2480a3f696e33e073fa65cde
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon Jan 8 19:22:00 2024 +0100

    improve curl backwards compatibility, de-duplicate code
---
 src/lib/merchant_api_curl_defaults.c | 23 ++---------------------
 1 file changed, 2 insertions(+), 21 deletions(-)

diff --git a/src/lib/merchant_api_curl_defaults.c 
b/src/lib/merchant_api_curl_defaults.c
index d565e5dd..710b3830 100644
--- a/src/lib/merchant_api_curl_defaults.c
+++ b/src/lib/merchant_api_curl_defaults.c
@@ -38,33 +38,14 @@ TALER_MERCHANT_curl_easy_get_ (const char *url)
                  curl_easy_setopt (eh,
                                    CURLOPT_URL,
                                    url));
-  GNUNET_assert (CURLE_OK ==
-                 curl_easy_setopt (eh,
-                                   CURLOPT_FOLLOWLOCATION,
-                                   1L));
-  if (0 == strcasecmp (url,
-                       "https://";))
-    GNUNET_assert (CURLE_OK ==
-                   curl_easy_setopt (eh,
-                                     CURLOPT_REDIR_PROTOCOLS_STR,
-                                     "https"));
-  else
-    GNUNET_assert (CURLE_OK ==
-                   curl_easy_setopt (eh,
-                                     CURLOPT_REDIR_PROTOCOLS_STR,
-                                     "http,https"));
+  TALER_curl_set_secure_redirect_policy (eh,
+                                         url);
   /* Enable compression (using whatever curl likes), see
      https://curl.se/libcurl/c/CURLOPT_ACCEPT_ENCODING.html  */
   GNUNET_break (CURLE_OK ==
                 curl_easy_setopt (eh,
                                   CURLOPT_ACCEPT_ENCODING,
                                   ""));
-  /* limit MAXREDIRS to 5 as a simple security measure against
-     a potential infinite loop caused by a malicious target */
-  GNUNET_assert (CURLE_OK ==
-                 curl_easy_setopt (eh,
-                                   CURLOPT_MAXREDIRS,
-                                   5L));
   GNUNET_assert (CURLE_OK ==
                  curl_easy_setopt (eh,
                                    CURLOPT_TCP_FASTOPEN,

-- 
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]