-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
Needs: Attention 👋This issue needs the attention of a contributor, typically because the OP has provided an update.This issue needs the attention of a contributor, typically because the OP has provided an update.Perfarea-middlewareIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresdesign-proposalThis issue represents a design proposal for a different issue, linked in the descriptionThis issue represents a design proposal for a different issue, linked in the description
Milestone
Description
Summary
RedirectRule.ApplyRuleis comparing the request path withPathString.Empty, which ends up being a string comparison.RedirectRule.ApplyRuleis boxing aPathString(1)(2).
Motivation and goals
This is in a hot path for applications that use redirections.
Detailed design
- Use
path.HasValueinstead. - 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
Metadata
Metadata
Assignees
Labels
Needs: Attention 👋This issue needs the attention of a contributor, typically because the OP has provided an update.This issue needs the attention of a contributor, typically because the OP has provided an update.Perfarea-middlewareIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresdesign-proposalThis issue represents a design proposal for a different issue, linked in the descriptionThis issue represents a design proposal for a different issue, linked in the description