mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-27 02:38:30 +02:00
* Create WireMock.Net.MimePart project * . * REFACTOR * ILRepack * -- * ... * x * x * . * fix * public class MimePartMatcher * shared * min * . * <!--<DelaySign>true</DelaySign>--> * Update README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
25 lines
968 B
C#
25 lines
968 B
C#
// Copyright © WireMock.Net
|
|
|
|
using System;
|
|
using System.Threading.Tasks;
|
|
using Stef.Validation;
|
|
using WireMock.Settings;
|
|
|
|
namespace WireMock.ResponseProviders;
|
|
|
|
internal class ProxyAsyncResponseProvider : IResponseProvider
|
|
{
|
|
private readonly Func<IRequestMessage, WireMockServerSettings, Task<IResponseMessage>> _responseMessageFunc;
|
|
private readonly WireMockServerSettings _settings;
|
|
|
|
public ProxyAsyncResponseProvider(Func<IRequestMessage, WireMockServerSettings, Task<IResponseMessage>> responseMessageFunc, WireMockServerSettings settings)
|
|
{
|
|
_responseMessageFunc = Guard.NotNull(responseMessageFunc);
|
|
_settings = Guard.NotNull(settings);
|
|
}
|
|
|
|
public async Task<(IResponseMessage Message, IMapping? Mapping)> ProvideResponseAsync(IMapping mapping, IRequestMessage requestMessage, WireMockServerSettings settings)
|
|
{
|
|
return (await _responseMessageFunc(requestMessage, _settings).ConfigureAwait(false), null);
|
|
}
|
|
} |