Fixed trackAllCaptures enum naming
This commit is contained in:
parent
623333a919
commit
c8b5a48b76
|
|
@ -27,7 +27,7 @@ namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite
|
||||||
public const string Rule = "rule";
|
public const string Rule = "rule";
|
||||||
public const string Rules = "rules";
|
public const string Rules = "rules";
|
||||||
public const string StopProcessing = "stopProcessing";
|
public const string StopProcessing = "stopProcessing";
|
||||||
public const string TrackingAllCaptures = "trackingAllCaptures";
|
public const string TrackAllCaptures = "trackAllCaptures";
|
||||||
public const string Type = "type";
|
public const string Type = "type";
|
||||||
public const string Url = "url";
|
public const string Url = "url";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -109,8 +109,8 @@ namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite
|
||||||
}
|
}
|
||||||
|
|
||||||
var grouping = ParseEnum(conditions, RewriteTags.LogicalGrouping, LogicalGrouping.MatchAll);
|
var grouping = ParseEnum(conditions, RewriteTags.LogicalGrouping, LogicalGrouping.MatchAll);
|
||||||
var trackingAllCaptures = ParseBool(conditions, RewriteTags.TrackingAllCaptures, defaultValue: false);
|
var trackAllCaptures = ParseBool(conditions, RewriteTags.TrackAllCaptures, defaultValue: false);
|
||||||
builder.AddUrlConditions(grouping, trackingAllCaptures);
|
builder.AddUrlConditions(grouping, trackAllCaptures);
|
||||||
|
|
||||||
foreach (var cond in conditions.Elements(RewriteTags.Add))
|
foreach (var cond in conditions.Elements(RewriteTags.Add))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite
|
||||||
// If there are no conditions specified
|
// If there are no conditions specified
|
||||||
if (_conditions == null)
|
if (_conditions == null)
|
||||||
{
|
{
|
||||||
AddUrlConditions(LogicalGrouping.MatchAll, trackingAllCaptures: false);
|
AddUrlConditions(LogicalGrouping.MatchAll, trackAllCaptures: false);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (patternSyntax)
|
switch (patternSyntax)
|
||||||
|
|
@ -144,7 +144,7 @@ namespace Microsoft.AspNetCore.Rewrite.Internal.IISUrlRewrite
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddUrlConditions(LogicalGrouping logicalGrouping, bool trackingAllCaptures)
|
public void AddUrlConditions(LogicalGrouping logicalGrouping, bool trackAllCaptures)
|
||||||
{
|
{
|
||||||
_conditions = new List<Condition>();
|
_conditions = new List<Condition>();
|
||||||
_matchAny = logicalGrouping == LogicalGrouping.MatchAny;
|
_matchAny = logicalGrouping == LogicalGrouping.MatchAny;
|
||||||
|
|
|
||||||
|
|
@ -240,14 +240,14 @@ namespace Microsoft.AspNetCore.Rewrite.Tests.UrlRewrite
|
||||||
<rules>
|
<rules>
|
||||||
<rule name=""Remove trailing slash"">
|
<rule name=""Remove trailing slash"">
|
||||||
<match url = ""(.*)/$""/>
|
<match url = ""(.*)/$""/>
|
||||||
<conditions trackingAllCaptures=""foo"">
|
<conditions trackAllCaptures=""foo"">
|
||||||
<add input=""{REQUEST_FILENAME}""/>
|
<add input=""{REQUEST_FILENAME}""/>
|
||||||
</conditions>
|
</conditions>
|
||||||
<action type=""Redirect"" url =""{R:1}"" />
|
<action type=""Redirect"" url =""{R:1}"" />
|
||||||
</rule>
|
</rule>
|
||||||
</rules>
|
</rules>
|
||||||
</rewrite>",
|
</rewrite>",
|
||||||
"Could not parse the UrlRewrite file. Message: 'The trackingAllCaptures parameter 'foo' was not recognized'. Line number '5': '14'.")]
|
"Could not parse the UrlRewrite file. Message: 'The trackAllCaptures parameter 'foo' was not recognized'. Line number '5': '14'.")]
|
||||||
[InlineData(
|
[InlineData(
|
||||||
@"<rewrite>
|
@"<rewrite>
|
||||||
<rules>
|
<rules>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue