diff --git a/Octokit/Clients/StatisticsClient.cs b/Octokit/Clients/StatisticsClient.cs
index 78bf197a..e1f18fb4 100644
--- a/Octokit/Clients/StatisticsClient.cs
+++ b/Octokit/Clients/StatisticsClient.cs
@@ -1,4 +1,5 @@
using System.Collections.Generic;
+using System.Net;
using System.Threading.Tasks;
namespace Octokit
@@ -19,13 +20,20 @@ namespace Octokit
/// The owner of the repository
/// The name of the repository
/// A list of
- public Task> GetContributors(string owner, string repositoryName)
+ public async Task> GetContributors(string owner, string repositoryName)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName");
- var endpoint = "/repos/{0}/{1}/stats/contributors".FormatUri(owner,repositoryName);
- return ApiConnection.Get>(endpoint);
+ var endpoint = "/repos/{0}/{1}/stats/contributors".FormatUri(owner, repositoryName);
+
+ var response = await Connection.GetAsync>(endpoint, null, null);
+
+ if (response.StatusCode == HttpStatusCode.Accepted)
+ {
+ return await GetContributors(owner, repositoryName);
+ }
+ return response.BodyAsObject;
}
}
}
\ No newline at end of file