Skip to content
This repository has been archived by the owner on Dec 20, 2018. It is now read-only.

Fixed Enable and negate flag issue. #140

Merged
merged 2 commits into from
Oct 24, 2016
Merged

Conversation

mikaelm12
Copy link
Contributor

For issues #138 and #139.

I also made the middleware throw when global rules are present since we don't actually handle them properly with the current implementation.

@Tratcher @muratg @BrennanConroy

@BrennanConroy
Copy link
Member

:shipit:

@BrennanConroy
Copy link
Member

Actually, this doesn't fix the enabled issue, see Justin's comment on the issue. Also, add a couple tests

@@ -38,6 +38,11 @@ private void ParseRules(XElement rules, IList<IISUrlRewriteRule> result)
return;
}

if(string.Equals(rules.Name.ToString(), "GlobalRules", StringComparison.OrdinalIgnoreCase))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: space

@mikaelm12
Copy link
Contributor Author

It does fix the enabled flag issue. Justin was mistaken

else
{
builder.Enabled = enabled;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if !Enabled, consider not parsing the rest of the rule. That would allow users to disable rules that use features we don't support, rather than having to delete them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good idea. The only thing is that if we don't parse the rest of the rule we allow the user to enter invalid rules since the checking isn't happening. Not a huge deal since the rule won't be enabled bit still something to consider

@mikaelm12
Copy link
Contributor Author

Ping @Tratcher @BrennanConroy

@BrennanConroy
Copy link
Member

:shipit:

@mikaelm12 mikaelm12 merged commit 2a153b3 into dev Oct 24, 2016
@mikaelm12 mikaelm12 deleted the mikaelm12/FixEnableAndNegateFlags branch October 24, 2016 21:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants