Skip to content

Commit

Permalink
Fix for Excessive header checker when excluding Cloudflare
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeavon authored and nathanwoulfe committed Oct 4, 2021
1 parent e416f06 commit 9abd071
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private async Task<HealthCheckStatus> CheckForHeaders()
var headersToCheckFor = new List<string> {"Server", "X-Powered-By", "X-AspNet-Version", "X-AspNetMvc-Version" };

// Ignore if server header is present and it's set to cloudflare
if (allHeaders.InvariantContains("Server") && response.Headers.TryGetValues("Server", out var serverHeaders) && serverHeaders.ToString().InvariantEquals("cloudflare"))
if (allHeaders.InvariantContains("Server") && response.Headers.TryGetValues("Server", out var serverHeaders) && serverHeaders.FirstOrDefault().InvariantEquals("cloudflare"))
{
headersToCheckFor.Remove("Server");
}
Expand Down

0 comments on commit 9abd071

Please sign in to comment.