From f63690c4d33df8b6720b7c35b8d59865cf3c83a7 Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Wed, 9 Dec 2015 17:06:13 +1030 Subject: [PATCH] obsolete a range of methods around GetArchiveLink Due to how the default HttpClientAdapter of Octokit will follow redirects by default, this API is no longer working. Marking it as obsolete. --- Octokit/Clients/RepositoryContentsClient.cs | 3 +++ Octokit/Helpers/ApiExtensions.cs | 1 + Octokit/Http/ApiConnection.cs | 1 + 3 files changed, 5 insertions(+) diff --git a/Octokit/Clients/RepositoryContentsClient.cs b/Octokit/Clients/RepositoryContentsClient.cs index 65dde713..7a23a6b6 100644 --- a/Octokit/Clients/RepositoryContentsClient.cs +++ b/Octokit/Clients/RepositoryContentsClient.cs @@ -116,6 +116,7 @@ namespace Octokit /// The owner of the repository /// The name of the repository /// + [Obsolete("Octokit's HTTP library now follows redirects by default - this API will be removed in a future release")] public Task GetArchiveLink(string owner, string name) { return GetArchiveLink(owner, name, ArchiveFormat.Tarball, string.Empty); @@ -144,6 +145,7 @@ namespace Octokit /// The name of the repository /// The format of the archive. Can be either tarball or zipball /// + [Obsolete("Octokit's HTTP library now follows redirects by default - this API will be removed in a future release")] public Task GetArchiveLink(string owner, string name, ArchiveFormat archiveFormat) { return GetArchiveLink(owner, name, archiveFormat, string.Empty); @@ -174,6 +176,7 @@ namespace Octokit /// The format of the archive. Can be either tarball or zipball /// A valid Git reference. /// + [Obsolete("Octokit's HTTP library now follows redirects by default - this API will be removed in a future release")] public Task GetArchiveLink(string owner, string name, ArchiveFormat archiveFormat, string reference) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); diff --git a/Octokit/Helpers/ApiExtensions.cs b/Octokit/Helpers/ApiExtensions.cs index 877a6a64..1f35908d 100644 --- a/Octokit/Helpers/ApiExtensions.cs +++ b/Octokit/Helpers/ApiExtensions.cs @@ -90,6 +90,7 @@ namespace Octokit return connection.Get(uri, null, null); } + [Obsolete("Octokit's HTTP library now follows redirects by default - this API will be removed in a future release")] public static Task> GetRedirect(this IConnection connection, Uri uri) { Ensure.ArgumentNotNull(connection, "connection"); diff --git a/Octokit/Http/ApiConnection.cs b/Octokit/Http/ApiConnection.cs index fb31b68d..dc6e0bdd 100644 --- a/Octokit/Http/ApiConnection.cs +++ b/Octokit/Http/ApiConnection.cs @@ -408,6 +408,7 @@ namespace Octokit /// URI of the API resource to get /// The URL returned by the API in the Location header /// Thrown when an API error occurs, or the API does not respond with a 302 Found + [Obsolete("Octokit's HTTP library now follows redirects by default - this API will be removed in a future release")] public async Task GetRedirect(Uri uri) { Ensure.ArgumentNotNull(uri, "uri");