mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-08-16 00:42:13 +02:00
@@ -342,7 +342,7 @@ internal class MappingConverter(MatcherMapper mapper)
|
||||
if (clientIPMatcher?.Matchers != null)
|
||||
{
|
||||
var clientIPMatchers = _mapper.Map(clientIPMatcher.Matchers);
|
||||
mappingModel.Request.Path = new ClientIPModel
|
||||
mappingModel.Request.ClientIP = new ClientIPModel
|
||||
{
|
||||
Matchers = clientIPMatchers,
|
||||
MatchOperator = clientIPMatchers?.Length > 1 ? clientIPMatcher.MatchOperator.ToString() : null
|
||||
|
||||
@@ -155,7 +155,8 @@ public partial class WireMockServer
|
||||
var clientIPModel = _settings.DefaultJsonSerializer.ParseJsonToken<ClientIPModel>(requestModel.ClientIP);
|
||||
if (clientIPModel.Matchers != null)
|
||||
{
|
||||
requestBuilder = requestBuilder.WithPath(clientIPModel.Matchers.Select(_matcherMapper.Map).OfType<IStringMatcher>().ToArray());
|
||||
var matchOperator = StringUtils.ParseMatchOperator(clientIPModel.MatchOperator);
|
||||
requestBuilder = requestBuilder.WithClientIP(matchOperator, clientIPModel.Matchers.Select(_matcherMapper.Map).OfType<IStringMatcher>().ToArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user