mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-05 03:30:34 +00:00
handle case insensitive headers when parsing for API rate limiting (#2175)
This commit is contained in:
@@ -53,6 +53,17 @@ namespace Octokit.Tests.Exceptions
|
||||
Assert.Equal(30, abuseException.RetryAfterSeconds);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WithRetryAfterCaseInsensitiveHeader_PopulatesRetryAfterSeconds()
|
||||
{
|
||||
var headerDictionary = new Dictionary<string, string> { { "retry-after", "20" } };
|
||||
|
||||
var response = new Response(HttpStatusCode.Forbidden, null, headerDictionary, "application/json");
|
||||
var abuseException = new AbuseException(response);
|
||||
|
||||
Assert.Equal(20, abuseException.RetryAfterSeconds);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WithZeroHeaderValue_RetryAfterSecondsIsZero()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user