Skip to content

Instantly share code, notes, and snippets.

@ByteDev
Created July 16, 2021 08:55
Show Gist options
  • Save ByteDev/56794ccc0645c89fdb1c73c76366cb98 to your computer and use it in GitHub Desktop.
Save ByteDev/56794ccc0645c89fdb1c73c76366cb98 to your computer and use it in GitHub Desktop.
public class UnauthorizedResponseHandler : HttpMessageHandler
{
    protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    {
        var response = new HttpResponseMessage(HttpStatusCode.Unauthorized);
        
        return Task.FromResult(response);
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment