From 1fcb8d3107a5a2813bb6f752154cb28fa815e549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9r=C3=B4me=20Fournier?= Date: Sun, 24 May 2026 12:51:25 +0200 Subject: [PATCH] std.net.curl: fix maxRedirects() interpretation of uint.max maxRedirects(uint maxRedirs) specify in its documentation string that uint.max can be used for infinite redirection. But in the code, when a uint.max value is used, redirects are disabled, by setting CurlOption.followlocation to 0. This PR switch off redirection if maxRedirs is equal to 0, and allow redirections up to maxRedirs otherwise. --- std/net/curl.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/std/net/curl.d b/std/net/curl.d index efbb4f8811c..59067ab9ba2 100644 --- a/std/net/curl.d +++ b/std/net/curl.d @@ -3234,7 +3234,7 @@ struct HTTP */ @property void maxRedirects(uint maxRedirs) { - if (maxRedirs == uint.max) + if (maxRedirs == 0) { // Disable p.curl.set(CurlOption.followlocation, 0);