Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UrlHelper.To in Obsolete case #2393

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

LordJZ
Copy link
Contributor

@LordJZ LordJZ commented Apr 16, 2024

The piece of code in question:

        public string To(string relativePath)
        {
            return _context.Options.PrefixPath +
                   (
#if FEATURE_OWIN
                       _owinContext?.Request.PathBase.Value ??
#endif
                       _context.Request.PathBase
                       + relativePath
                   );
        }

With FEATURE_OWIN this compiles to the following:

return _context.Options.PrefixPath +
    (_owinContext?.Request.PathBase.Value ??
        (_context.Request.PathBase + relativePath));

Note how in the Owin case the relativePath value is lost.

Not a big deal since the Owin case is deprecated via constructor attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant