mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-17 07:36:47 +01:00
Make SaveMapping and SaveMappingToFile settings independent. (#317)
When both are true - mappings are applied instantly and may affect further requests recording.
This commit is contained in:
committed by
Stef Heyenrath
parent
6ee4a42f0a
commit
4bfd72cdc3
@@ -266,10 +266,14 @@ namespace WireMock.Server
|
||||
|
||||
var responseMessage = await HttpClientHelper.SendAsync(_httpClientForProxy, requestMessage, proxyUriWithRequestPathAndQuery.AbsoluteUri);
|
||||
|
||||
if (settings.ProxyAndRecordSettings.SaveMapping)
|
||||
if (settings.ProxyAndRecordSettings.SaveMapping || settings.ProxyAndRecordSettings.SaveMappingToFile)
|
||||
{
|
||||
var mapping = ToMapping(requestMessage, responseMessage, settings.ProxyAndRecordSettings.BlackListedHeaders ?? new string[] { });
|
||||
_options.Mappings.TryAdd(mapping.Guid, mapping);
|
||||
|
||||
if (settings.ProxyAndRecordSettings.SaveMapping)
|
||||
{
|
||||
_options.Mappings.TryAdd(mapping.Guid, mapping);
|
||||
}
|
||||
|
||||
if (settings.ProxyAndRecordSettings.SaveMappingToFile)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user