Use service provider HttpMessageHandler factory for GitHub client

This commit is contained in:
Jordan Dominion
2025-02-16 17:35:33 -05:00
parent 65e4e9abc2
commit 3df4771f89
5 changed files with 70 additions and 13 deletions
@@ -0,0 +1,19 @@
using System;
using System.Net.Http;
namespace Tgstation.Server.Host.Tests
{
/// <summary>
/// Basic <see cref="IHttpMessageHandlerFactory"/> implementation for testiong
/// </summary>
public sealed class BasicHttpMessageHandlerFactory : IHttpMessageHandlerFactory, IDisposable
{
readonly HttpClientHandler handler = new();
public HttpMessageHandler CreateHandler(string name)
=> handler;
public void Dispose()
=> handler.Dispose();
}
}