mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-23 13:07:07 +01:00
Use service provider HttpMessageHandler factory for GitHub client
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user