mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-01 18:35:35 +00:00
deprecate the optional AllowAutoRedirect parameter
This commit is contained in:
@@ -104,7 +104,6 @@ namespace Octokit.Internal
|
||||
var fullUri = new Uri(request.BaseAddress, request.Endpoint);
|
||||
requestMessage = new HttpRequestMessage(request.Method, fullUri);
|
||||
|
||||
requestMessage.Properties["AllowAutoRedirect"] = request.AllowAutoRedirect;
|
||||
foreach (var header in request.Headers)
|
||||
{
|
||||
requestMessage.Headers.Add(header.Key, header.Value);
|
||||
@@ -166,7 +165,6 @@ namespace Octokit.Internal
|
||||
|
||||
internal class RedirectHandler : DelegatingHandler
|
||||
{
|
||||
public const string AllowAutoRedirectKey = "AllowAutoRedirect";
|
||||
public const string RedirectCountKey = "RedirectCount";
|
||||
public bool Enabled { get; set; }
|
||||
|
||||
@@ -177,10 +175,6 @@ namespace Octokit.Internal
|
||||
// Can't redirect without somewhere to redirect too. Throw?
|
||||
if (response.Headers.Location == null) return response;
|
||||
|
||||
// Don't redirect if redirection has been disabled for this request
|
||||
var allowAutoRedirect = (bool)request.Properties[AllowAutoRedirectKey];
|
||||
if (!allowAutoRedirect) return response; // Throw?
|
||||
|
||||
// Don't redirect if we exceed max number of redirects
|
||||
var redirectCount = 0;
|
||||
if (request.Properties.Keys.Contains(RedirectCountKey))
|
||||
|
||||
Reference in New Issue
Block a user