diff --git a/src/Microsoft.IIS.Administration.WebServer.UrlRewrite/Helpers/OutboundRulesHelper.cs b/src/Microsoft.IIS.Administration.WebServer.UrlRewrite/Helpers/OutboundRulesHelper.cs index ef8b734..b4849a1 100644 --- a/src/Microsoft.IIS.Administration.WebServer.UrlRewrite/Helpers/OutboundRulesHelper.cs +++ b/src/Microsoft.IIS.Administration.WebServer.UrlRewrite/Helpers/OutboundRulesHelper.cs @@ -340,9 +340,9 @@ namespace Microsoft.IIS.Administration.WebServer.UrlRewrite } // - // rewrite - if (fields.Exists("rewrite")) { - obj.rewrite = rule.Action.Type == OutboundActionType.Rewrite ? true : false; + // enabled + if (fields.Exists("enabled")) { + obj.enabled = rule.Action.Type == OutboundActionType.Rewrite ? true : false; } // @@ -703,7 +703,7 @@ namespace Microsoft.IIS.Administration.WebServer.UrlRewrite } DynamicHelper.If((object)model.pattern, v => rule.Match.Pattern = v); - DynamicHelper.If((object)model.rewrite, v => rule.Action.Type = v ? OutboundActionType.Rewrite : OutboundActionType.None); + DynamicHelper.If((object)model.enabled, v => rule.Action.Type = v ? OutboundActionType.Rewrite : OutboundActionType.None); DynamicHelper.If((object)model.rewrite_value, v => rule.Action.RewriteValue = v); DynamicHelper.If((object)model.ignore_case, v => rule.Match.IgnoreCase = v); DynamicHelper.If((object)model.negate, v => rule.Match.Negate = v); diff --git a/test/Microsoft.IIS.Administration.Tests/UrlRewrite.cs b/test/Microsoft.IIS.Administration.Tests/UrlRewrite.cs index c9e187c..05423b2 100644 --- a/test/Microsoft.IIS.Administration.Tests/UrlRewrite.cs +++ b/test/Microsoft.IIS.Administration.Tests/UrlRewrite.cs @@ -549,7 +549,7 @@ namespace Microsoft.IIS.Administration.Tests ignore_case = false, negate = true, stop_processing = false, - rewrite = false, + enabled = false, rewrite_value = "test rewrite value", condition_match_constraints = "match_any", track_all_captures = true, @@ -583,7 +583,7 @@ namespace Microsoft.IIS.Administration.Tests ignore_case = true, negate = false, stop_processing = true, - rewrite = true, + enabled = true, rewrite_value = "test rewrite update", condition_match_constraints = "match_all", track_all_captures = false, @@ -1082,7 +1082,7 @@ namespace Microsoft.IIS.Administration.Tests Assert.Equal(a.Value("ignore_case"), b.Value("ignore_case")); Assert.Equal(a.Value("negate"), b.Value("negate")); Assert.Equal(a.Value("stop_processing"), b.Value("stop_processing")); - Assert.Equal(a.Value("rewrite"), b.Value("rewrite")); + Assert.Equal(a.Value("enabled"), b.Value("enabled")); Assert.Equal(a.Value("rewrite_value"), b.Value("rewrite_value")); Assert.Equal(a.Value("condition_match_constraints"), b.Value("condition_match_constraints")); Assert.Equal(a.Value("track_all_captures"), b.Value("track_all_captures"));