// Copyright © WireMock.Net using Microsoft.AspNetCore.Http; using Stef.Validation; using WireMock.Settings; namespace WireMock.ResponseProviders; internal class ProxyAsyncResponseProvider : IResponseProvider { private readonly Func> _responseMessageFunc; private readonly WireMockServerSettings _settings; public ProxyAsyncResponseProvider(Func> responseMessageFunc, WireMockServerSettings settings) { _responseMessageFunc = Guard.NotNull(responseMessageFunc); _settings = Guard.NotNull(settings); } /// public async Task<(IResponseMessage Message, IMapping? Mapping)> ProvideResponseAsync(IMapping mapping, HttpContext context, IRequestMessage requestMessage, WireMockServerSettings settings) { return (await _responseMessageFunc(context, requestMessage, _settings).ConfigureAwait(false), null); } }