mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-26 18:28:27 +02:00
1.7.x (#1268)
* Fix construction of path in OpenApiParser (#1265) * Server-Sent Events (#1269) * Server Side Events * fixes * await HandleSseStringAsync(responseMessage, response, bodyData); * 1.7.5-preview-01 * IBlockingQueue * 1.7.5-preview-02 (03 April 2025) * IBlockingQueue * ... * Support OpenApi V31 (#1279) * Support OpenApi V31 * Update src/WireMock.Net.OpenApiParser/Extensions/OpenApiSchemaExtensions.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fx --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Add ProtoDefinitionHelper.FromDirectory (#1263) * Add ProtoDefinitionHelper.FromDirectory * . * unix-windows * move test * imports in the proto files indeed should use a forward slash * updates * . * private Func<IdOrTexts> ProtoDefinitionFunc() * OpenTelemetry * . * fix path utils --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -51,6 +51,26 @@ public partial class Response
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public IResponseBuilder WithSseBody(Func<IRequestMessage, IBlockingQueue<string?>, Task> bodyFactory, TimeSpan? timeout = null)
|
||||
{
|
||||
Guard.NotNull(bodyFactory);
|
||||
|
||||
var queue = new BlockingQueue<string?>(timeout);
|
||||
|
||||
return WithCallbackInternal(true, req => new ResponseMessage
|
||||
{
|
||||
BodyData = new BodyData
|
||||
{
|
||||
DetectedBodyType = BodyType.SseString,
|
||||
SseStringQueue = queue,
|
||||
BodyAsSseStringTask = bodyFactory(req, queue),
|
||||
Encoding = Encoding.UTF8,
|
||||
IsFuncUsed = "Func<IRequestMessage, BlockingQueue<string?>, Task>"
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public IResponseBuilder WithBody(byte[] body, string? destination = BodyDestinationFormat.SameAsSource, Encoding? encoding = null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user