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

Merged
merged 1 commit into from
May 28, 2024
Merged

Fix UrlHelper.To in Obsolete case #2393

merged 1 commit into from
May 28, 2024

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.

@odinserj
Copy link
Member

Thanks @LordJZ, definitely makes sense!

@odinserj odinserj merged commit 36ba66c into HangfireIO:main May 28, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

2 participants