]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
url: change default value for CURLOPT_MAXREDIRS to 30
authorDaniel Stenberg <daniel@haxx.se>
Wed, 2 Aug 2023 16:03:59 +0000 (18:03 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 2 Aug 2023 21:59:59 +0000 (23:59 +0200)
It was previously unlimited by default, but that's not a sensible
default. While changing this has a remote risk of breaking an existing
use case, I figure it is more likely to actually save users from loops.

Closes #11581

docs/libcurl/opts/CURLOPT_MAXREDIRS.3
lib/url.c

index 3aeb0746c8645bbdbeb44e7de97136c4bb96f801..bd1108931ca6ca1c4bbe2901672118d6ace06434 100644 (file)
@@ -41,7 +41,7 @@ Setting the limit to 0 will make libcurl refuse any redirect.
 
 Set it to -1 for an infinite number of redirects.
 .SH DEFAULT
--1, unlimited
+30 (since 8.3.0), it was previously unlimited.
 .SH PROTOCOLS
 HTTP(S)
 .SH EXAMPLE
index 8eecfc4214399b9e601f5a9e6f3a2b0963fccaea..1d6f2fad42b8e3190acb56aa5c2006fe617a5a8a 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -490,7 +490,7 @@ CURLcode Curl_init_userdefined(struct Curl_easy *data)
 
   set->filesize = -1;        /* we don't know the size */
   set->postfieldsize = -1;   /* unknown size */
-  set->maxredirs = -1;       /* allow any amount by default */
+  set->maxredirs = 30;       /* sensible default */
 
   set->method = HTTPREQ_GET; /* Default HTTP request */
 #ifndef CURL_DISABLE_RTSP