mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-26 18:28:27 +02:00
Add Grpc ProtoBuf support (request-response) (#1047)
* ProtoBuf
* .
* x
* ---
* x
* fx
* ...
* sc
* ...
* .
* groen
* x
* fix tests
* ok!?
* fix tests
* fix tests
* !
* x
* 6
* .
* x
* ivaluematcher
* transformer
* .
* sc
* .
* mapping
* x
* tra
* com
* ...
* .
* .
* .
* AddProtoDefinition
* .
* set
* grpahj
* .
* .
* IdOrText
* ...
* async
* async2
* .
* t
* nuget
* <PackageReference Include="ProtoBufJsonConverter" Version="0.2.0-preview-04" />
* http version
* tests
* .WithHttpVersion("2")
* <PackageReference Include="ProtoBufJsonConverter" Version="0.2.0" />
* HttpVersionParser
This commit is contained in:
@@ -14,9 +14,12 @@ namespace WireMock;
|
||||
/// </summary>
|
||||
public class ResponseMessage : IResponseMessage
|
||||
{
|
||||
/// <inheritdoc cref="IResponseMessage.Headers" />
|
||||
/// <inheritdoc />
|
||||
public IDictionary<string, WireMockList<string>>? Headers { get; set; } = new Dictionary<string, WireMockList<string>>();
|
||||
|
||||
/// <inheritdoc />
|
||||
public IDictionary<string, WireMockList<string>>? TrailingHeaders { get; set; } = new Dictionary<string, WireMockList<string>>();
|
||||
|
||||
/// <inheritdoc cref="IResponseMessage.StatusCode" />
|
||||
public object? StatusCode { get; set; }
|
||||
|
||||
@@ -35,23 +38,43 @@ public class ResponseMessage : IResponseMessage
|
||||
/// <inheritdoc cref="IResponseMessage.FaultPercentage" />
|
||||
public double? FaultPercentage { get; set; }
|
||||
|
||||
/// <inheritdoc cref="IResponseMessage.AddHeader(string, string)" />
|
||||
/// <inheritdoc />
|
||||
public void AddHeader(string name, string value)
|
||||
{
|
||||
Headers ??= new Dictionary<string, WireMockList<string>>();
|
||||
Headers.Add(name, value);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IResponseMessage.AddHeader(string, string[])" />
|
||||
/// <inheritdoc />
|
||||
public void AddHeader(string name, params string[] values)
|
||||
{
|
||||
Guard.NotNullOrEmpty(values);
|
||||
|
||||
Headers ??= new Dictionary<string, WireMockList<string>>();
|
||||
var newHeaderValues = Headers.TryGetValue(name, out WireMockList<string>? existingValues)
|
||||
var newHeaderValues = Headers.TryGetValue(name, out var existingValues)
|
||||
? values.Union(existingValues).ToArray()
|
||||
: values;
|
||||
|
||||
Headers[name] = newHeaderValues;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void AddTrailingHeader(string name, string value)
|
||||
{
|
||||
TrailingHeaders ??= new Dictionary<string, WireMockList<string>>();
|
||||
TrailingHeaders.Add(name, value);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void AddTrailingHeader(string name, params string[] values)
|
||||
{
|
||||
Guard.NotNullOrEmpty(values);
|
||||
|
||||
TrailingHeaders ??= new Dictionary<string, WireMockList<string>>();
|
||||
var newHeaderValues = TrailingHeaders.TryGetValue(name, out var existingValues)
|
||||
? values.Union(existingValues).ToArray()
|
||||
: values;
|
||||
|
||||
TrailingHeaders[name] = newHeaderValues;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user