From 68167dc7e64f05db889bd4f71dff29bdbfcf0cd3 Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Fri, 7 Apr 2023 14:04:16 +0530 Subject: [PATCH] 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. --- Apps/FailoverApp/HealthCheck.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Apps/FailoverApp/HealthCheck.cs b/Apps/FailoverApp/HealthCheck.cs index af3cbefd..9ef1b13b 100644 --- a/Apps/FailoverApp/HealthCheck.cs +++ b/Apps/FailoverApp/HealthCheck.cs @@ -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;