In ExecuteHttpProxyOperationAsync the following code throws if IHttpClientFactory is not registered. Wasn't obvious to me what the cause was, ended up downloading the code and stepping through
var httpClient = context.RequestServices
.GetService<IHttpClientFactory>()
.CreateClient(options?.HttpClientName ?? Helpers.HttpProxyClientName);
Perhaps something along these lines:
var clientFactory = context.RequestServices.GetService<IHttpClientFactory>()
?? throw new InvalidOperationException("IHttpClientFactory not registered. You need to add builder.Services.AddHttpClient(); during startup");
var httpClient = clientFactory.CreateClient(options?.HttpClientName ?? Helpers.HttpProxyClientName);
In
ExecuteHttpProxyOperationAsync
the following code throws if IHttpClientFactory is not registered. Wasn't obvious to me what the cause was, ended up downloading the code and stepping throughPerhaps something along these lines: