anastasis

Credential backup and recovery protocol and service
Log | Files | Refs | Submodules | README | LICENSE

commit 2a7c03c03bacc4e7a57b8f22552ea221d9c15f45
parent 276b23ce4a4fdc48f92d54c1d8dc477d4e95a5d3
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon,  8 Jan 2024 19:22:21 +0100

improve curl backwards compatibility, de-duplicate code

Diffstat:
Msrc/restclient/anastasis_api_curl_defaults.c | 23++---------------------
1 file changed, 2 insertions(+), 21 deletions(-)

diff --git 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 ==