ProxySettings : Add logic to not save some requests depending on HttpMethods (#900)

* Add ExcludedHttpMethods to ProxySettings

* tst

* fix

* SaveMappingSettings

* .
This commit is contained in:
Stef Heyenrath
2023-03-09 15:28:52 +01:00
committed by GitHub
parent 61cdc13fae
commit 674fa89c3e
9 changed files with 140 additions and 12 deletions

View File

@@ -28,9 +28,28 @@ public class ProxyAndRecordSettings : HttpClientSettings
/// <summary>
/// Only save request/response to the internal Mappings if the status code is included in this pattern. (Note that SaveMapping must also be set to true.)
/// The pattern can contain a single value like "200", but also ranges like "2xx", "100,300,600" or "100-299,6xx" are supported.
///
/// Deprecated : use SaveMappingSettings.
/// </summary>
[PublicAPI]
public string SaveMappingForStatusCodePattern { get; set; } = "*";
public string SaveMappingForStatusCodePattern
{
set
{
if (SaveMappingSettings is null)
{
SaveMappingSettings = new ProxySaveMappingSettings();
}
SaveMappingSettings.StatusCodePattern = value;
}
}
/// <summary>
/// Additional SaveMappingSettings.
/// </summary>
[PublicAPI]
public ProxySaveMappingSettings? SaveMappingSettings { get; set; }
/// <summary>
/// Defines a list from headers which will be excluded from the saved mappings.