summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-01-08 19:22:21 +0100
committerChristian Grothoff <christian@grothoff.org>2024-01-08 19:22:24 +0100
commit2a7c03c03bacc4e7a57b8f22552ea221d9c15f45 (patch)
tree74e834471c23626f6915412ea3f2c48cb46784c1
parent276b23ce4a4fdc48f92d54c1d8dc477d4e95a5d3 (diff)
downloadanastasis-2a7c03c03bacc4e7a57b8f22552ea221d9c15f45.tar.gz
anastasis-2a7c03c03bacc4e7a57b8f22552ea221d9c15f45.tar.bz2
anastasis-2a7c03c03bacc4e7a57b8f22552ea221d9c15f45.zip
improve curl backwards compatibility, de-duplicate code
-rw-r--r--src/restclient/anastasis_api_curl_defaults.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/restclient/anastasis_api_curl_defaults.c b/src/restclient/anastasis_api_curl_defaults.c
index 02a570a..6115280 100644
--- a/src/restclient/anastasis_api_curl_defaults.c
+++ b/src/restclient/anastasis_api_curl_defaults.c
@@ -34,31 +34,12 @@ ANASTASIS_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);
GNUNET_assert (CURLE_OK ==
curl_easy_setopt (eh,
CURLOPT_TCP_FASTOPEN,
1L));
- /* 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));
/* Enable compression (using whatever curl likes), see
https://curl.se/libcurl/c/CURLOPT_ACCEPT_ENCODING.html */
GNUNET_break (CURLE_OK ==