Fix: Remove MaxAutomaticRedirections when AllowAutoRedirect is false

MaxAutomaticRedirections cannot be set to 0 in .NET 9.0. When AllowAutoRedirect
is false, the MaxAutomaticRedirections property should not be set at all.

This fixes the TeleBot TOR proxy configuration crash.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
SysAdmin 2025-10-03 12:43:30 +01:00
parent 340fc89411
commit 2ee2ee79e6

View File

@ -36,7 +36,6 @@ namespace TeleBot.Http
}, },
UseProxy = true, UseProxy = true,
AllowAutoRedirect = false, // Prevent redirect-based deanonymization AllowAutoRedirect = false, // Prevent redirect-based deanonymization
MaxAutomaticRedirections = 0,
PooledConnectionLifetime = TimeSpan.FromMinutes(5), // Rotate circuits PooledConnectionLifetime = TimeSpan.FromMinutes(5), // Rotate circuits
PooledConnectionIdleTimeout = TimeSpan.FromMinutes(2) PooledConnectionIdleTimeout = TimeSpan.FromMinutes(2)
}; };