Failover.HealthCheck: updated implementation to disable http auto redirect which is causing to fail to verify the health status of the actual server in question.

This commit is contained in:
Shreyas Zare
2023-04-07 14:04:16 +05:30
parent 7a2a43d126
commit 68167dc7e6

View File

@@ -133,8 +133,7 @@ namespace Failover
httpHandler.PooledConnectionIdleTimeout = TimeSpan.FromMilliseconds(Math.Max(10000, _timeout));
httpHandler.Proxy = proxy;
httpHandler.UseProxy = proxy is not null;
httpHandler.AllowAutoRedirect = true;
httpHandler.MaxAutomaticRedirections = 10;
httpHandler.AllowAutoRedirect = false;
_httpHandler = httpHandler;
handlerChanged = true;
@@ -148,8 +147,7 @@ namespace Failover
httpHandler.PooledConnectionIdleTimeout = TimeSpan.FromMilliseconds(Math.Max(10000, _timeout));
httpHandler.Proxy = proxy;
httpHandler.UseProxy = proxy is not null;
httpHandler.AllowAutoRedirect = true;
httpHandler.MaxAutomaticRedirections = 10;
httpHandler.AllowAutoRedirect = false;
SocketsHttpHandler oldHttpHandler = _httpHandler;
_httpHandler = httpHandler;