Skip to content

Commit

Permalink
Merge pull request #10 from editor-tools/fixes/2560-case-insensitive-…
Browse files Browse the repository at this point in the history
…header

Case insensitive X-GitHub-Request-Id
  • Loading branch information
jcansdale authored Oct 27, 2020
2 parents a51818a + 54d023d commit a25a399
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Octokit/Clients/Enterprise/EnterpriseProbe.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text.RegularExpressions;
Expand Down Expand Up @@ -103,7 +104,8 @@ public async Task<EnterpriseProbeResult> Probe(Uri enterpriseBaseUrl)

static bool IsEnterpriseResponse(IResponse response)
{
return response.Headers.ContainsKey("X-GitHub-Request-Id");
// Use fix from https://github.com/octokit/octokit.net/pull/2175
return response.Headers.Any(h => string.Equals(h.Key, "X-GitHub-Request-Id", StringComparison.OrdinalIgnoreCase));
}
}

Expand All @@ -125,4 +127,4 @@ public enum EnterpriseProbeResult
/// </summary>
Failed
}
}
}

0 comments on commit a25a399

Please sign in to comment.