38 references to RewriteTags
Microsoft.AspNetCore.Rewrite (38)
IISUrlRewrite\RewriteMapParser.cs (6)
15
var mapsElement = xmlRoot.Descendants(
RewriteTags
.RewriteMaps).SingleOrDefault();
22
foreach (var mapElement in mapsElement.Elements(
RewriteTags
.RewriteMap))
24
var map = new IISRewriteMap(mapElement.Attribute(
RewriteTags
.Name)?.Value!);
25
foreach (var addElement in mapElement.Elements(
RewriteTags
.Add))
27
map[addElement.Attribute(
RewriteTags
.Key)!.Value.ToLowerInvariant()] = addElement.Attribute(
RewriteTags
.Value)!.Value;
IISUrlRewrite\UrlRewriteFileParser.cs (32)
24
var xmlRoot = xmlDoc.Descendants(
RewriteTags
.Rewrite).FirstOrDefault();
28
throw new InvalidUrlRewriteFormatException(new XElement(
RewriteTags
.Rewrite), "The root element '<rewrite>' is missing");
34
ParseRules(xmlRoot.Descendants(
RewriteTags
.GlobalRules).FirstOrDefault(), result, global: true);
35
ParseRules(xmlRoot.Descendants(
RewriteTags
.Rules).FirstOrDefault(), result, global: false);
46
foreach (var rule in rules.Elements(
RewriteTags
.Rule))
60
builder.Name = rule.Attribute(
RewriteTags
.Name)?.Value;
62
if (ParseBool(rule,
RewriteTags
.Enabled, defaultValue: true))
71
var patternSyntax = ParseEnum(rule,
RewriteTags
.PatternSyntax, PatternSyntax.ECMAScript);
72
var stopProcessing = ParseBool(rule,
RewriteTags
.StopProcessing, defaultValue: false);
74
var match = rule.Element(
RewriteTags
.Match);
80
var action = rule.Element(
RewriteTags
.Action);
87
ParseConditions(rule.Element(
RewriteTags
.Conditions), builder, patternSyntax);
93
var parsedInputString = match.Attribute(
RewriteTags
.Url)?.Value;
99
var ignoreCase = ParseBool(match,
RewriteTags
.IgnoreCase, defaultValue: true);
100
var negate = ParseBool(match,
RewriteTags
.Negate, defaultValue: false);
111
var grouping = ParseEnum(conditions,
RewriteTags
.LogicalGrouping, LogicalGrouping.MatchAll);
112
var trackAllCaptures = ParseBool(conditions,
RewriteTags
.TrackAllCaptures, defaultValue: false);
113
var adds = conditions.Elements(
RewriteTags
.Add);
129
var ignoreCase = ParseBool(conditionElement,
RewriteTags
.IgnoreCase, defaultValue: true);
130
var negate = ParseBool(conditionElement,
RewriteTags
.Negate, defaultValue: false);
131
var matchType = ParseEnum(conditionElement,
RewriteTags
.MatchType, MatchType.Pattern);
132
var parsedInputString = conditionElement.Attribute(
RewriteTags
.Input)?.Value;
139
var parsedPatternString = conditionElement.Attribute(
RewriteTags
.Pattern)?.Value;
190
var actionType = ParseEnum(urlAction,
RewriteTags
.Type, ActionType.None);
200
if (urlAction.Attribute(
RewriteTags
.Url) != null)
202
url = urlAction.Attribute(
RewriteTags
.Url)!.Value;
210
var appendQuery = ParseBool(urlAction,
RewriteTags
.AppendQueryString, defaultValue: true);
218
var redirectType = ParseEnum(urlAction,
RewriteTags
.RedirectType, RedirectType.Permanent);
227
if (!int.TryParse(urlAction.Attribute(
RewriteTags
.StatusCode)?.Value, NumberStyles.None, CultureInfo.InvariantCulture, out statusCode))
237
if (!string.IsNullOrEmpty(urlAction.Attribute(
RewriteTags
.SubStatusCode)?.Value))
242
var statusReason = urlAction.Attribute(
RewriteTags
.StatusReason)?.Value;
243
var statusDescription = urlAction.Attribute(
RewriteTags
.StatusDescription)?.Value;