summaryrefslogtreecommitdiff
path: root/src/restclient/anastasis_api_curl_defaults.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/restclient/anastasis_api_curl_defaults.c')
-rw-r--r--src/restclient/anastasis_api_curl_defaults.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/restclient/anastasis_api_curl_defaults.c b/src/restclient/anastasis_api_curl_defaults.c
index e052517..33665e0 100644
--- a/src/restclient/anastasis_api_curl_defaults.c
+++ b/src/restclient/anastasis_api_curl_defaults.c
@@ -42,5 +42,17 @@ ANASTASIS_curl_easy_get_ (const char *url)
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 ==
+ curl_easy_setopt (eh,
+ CURLOPT_ACCEPT_ENCODING,
+ ""));
return eh;
}