Skip to content

[regression 8.15.0->8.16.0] --max-redirs -1 treated as --max-redirs 0 #18571

@aclight

Description

@aclight

I did this

.\curl.exe --max-redirs -1 --follow http://google.com
curl: (47) Maximum (0) redirects followed

I expected the following

I expected curl to follow as many redirects as necessary to get the contents at the URL (basically response=200)

curl/libcurl version

curl 8.16.0 (x86_64-w64-mingw32) libcurl/8.16.0 LibreSSL/4.1.0 zlib/1.3.1.zlib-ng brotli/1.1.0 zstd/1.5.7 WinIDN libpsl/0.21.5 libssh2/1.11.1 nghttp2/1.67.1 ngtcp2/1.15.1 nghttp3/1.11.0
Release-Date: 2025-09-10
Protocols: dict file ftp ftps gopher gophers http https imap imaps ipfs ipns ldap ldaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS brotli CAcert HSTS HTTP2 HTTP3 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM PSL SPNEGO SSL SSLS-EXPORT SSPI threadsafe UnixSockets zstd

operating system

Microsoft Windows 11 Pro (24H2)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions