-
-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ProxySettings : Add logic to not save some requests depending on Http…
…Methods (#900) * Add ExcludedHttpMethods to ProxySettings * tst * fix * SaveMappingSettings * .
- Loading branch information
Showing
9 changed files
with
140 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using WireMock.Matchers; | ||
|
||
namespace WireMock.Settings; | ||
|
||
public class ProxySaveMappingSetting<T> | ||
{ | ||
public MatchBehaviour MatchBehaviour { get; } = MatchBehaviour.AcceptOnMatch; | ||
|
||
public T Value { get; private set; } | ||
|
||
public ProxySaveMappingSetting(T value, MatchBehaviour matchBehaviour = MatchBehaviour.AcceptOnMatch) | ||
{ | ||
Value = value; | ||
MatchBehaviour = matchBehaviour; | ||
} | ||
|
||
public static implicit operator ProxySaveMappingSetting<T>(T value) => new ProxySaveMappingSetting<T>(value); | ||
|
||
public static implicit operator T(ProxySaveMappingSetting<T> @this) => @this.Value; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using JetBrains.Annotations; | ||
|
||
namespace WireMock.Settings; | ||
|
||
/// <summary> | ||
/// ProxySaveMappingSettings | ||
/// </summary> | ||
public class ProxySaveMappingSettings | ||
{ | ||
/// <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. | ||
/// </summary> | ||
[PublicAPI] | ||
public ProxySaveMappingSetting<string>? StatusCodePattern { get; set; } = "*"; | ||
|
||
/// <summary> | ||
/// Only save these Http Methods. (Note that SaveMapping must also be set to true.) | ||
/// </summary> | ||
[PublicAPI] | ||
public ProxySaveMappingSetting<string[]>? HttpMethods { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters