diff --git a/DevProxy.Plugins/Behavior/GenericRandomErrorPlugin.cs b/DevProxy.Plugins/Behavior/GenericRandomErrorPlugin.cs index c0981b99..92ed9bc9 100644 --- a/DevProxy.Plugins/Behavior/GenericRandomErrorPlugin.cs +++ b/DevProxy.Plugins/Behavior/GenericRandomErrorPlugin.cs @@ -183,7 +183,8 @@ private ThrottlingInfo ShouldThrottle(Request request, string throttlingKey) return false; } - if (errorResponse.Request.Method != request.Method) + if (errorResponse.Request.Method is not null && + errorResponse.Request.Method != request.Method) { return false; } diff --git a/DevProxy.Plugins/Models/GenericErrorResponse.cs b/DevProxy.Plugins/Models/GenericErrorResponse.cs index 87b7199a..289b7820 100644 --- a/DevProxy.Plugins/Models/GenericErrorResponse.cs +++ b/DevProxy.Plugins/Models/GenericErrorResponse.cs @@ -13,7 +13,7 @@ public class GenericErrorResponse public class GenericErrorResponseRequest { public string? BodyFragment { get; set; } - public string Method { get; set; } = "GET"; + public string? Method { get; set; } public string Url { get; set; } = string.Empty; }