Skip to content

Commit

Permalink
disable auto redirect as we handle it
Browse files Browse the repository at this point in the history
  • Loading branch information
aspriddell committed Jul 14, 2020
1 parent f5fb1d7 commit aed8468
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ public HeaderPreservingRedirectHandler()
}

public HeaderPreservingRedirectHandler(HttpMessageHandler innerHandler)
: base(innerHandler)
{
if (innerHandler is HttpClientHandler clientHandler)
{
clientHandler.AllowAutoRedirect = false;
InnerHandler = clientHandler;
}
}

protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Expand Down

0 comments on commit aed8468

Please sign in to comment.