Closed
Description
Summary
RedirectRule.ApplyRule
is comparing the request path withPathString.Empty
, which ends up being a string comparison.RedirectRule.ApplyRule
is boxing aPathString
(1)(2).
Motivation and goals
This is in a hot path for applications that use redirections.
Detailed design
- Use
path.HasValue
instead. - Use
pathBase.ToUriComponent()
instead.- A better option would be use
UriHelper.BuildRelative
. The current implementation doesn't encode the path; only the path base and the query string.
- A better option would be use