-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
7919: The Alias UI links for sites using UrlPrefix are broken #7930
7919: The Alias UI links for sites using UrlPrefix are broken #7930
Conversation
…hat strips first / in urls for sites using UrlPrefix
Looks good, but can someone try it and confirm it fixes the issue? I am worried as the code explicitly handled the prefix. |
@sebastienros tested and slightly adjusted, good to go! |
if (!string.IsNullOrWhiteSpace(_tenantPrefix) | ||
&& path.StartsWith("~/") | ||
&& !CommonLocations.Any(gpp => path.StartsWith(gpp, StringComparison.OrdinalIgnoreCase))) { | ||
return base.Href("~/" + _tenantPrefix + path.Substring(1), pathParts); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the substring start index parameter changed?
Since code gets to line 196 only if path starts with ~, it stripped ~/ in the previous version of the file; now it only strips the ~ character: is it correct keeping the / character?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI this is only applied if there is a tenant prefix. e.g., the base URL is mysite.com/mytenant
. In this case you still need the /
between the tenant prefix and the rest of the path. Without this change all the Hrefs were broken if you provided a path that started with ~/
when there's a tenant prefix.
Fixes #7919. Also reverting this commit's changes to the Href method (9c2ea80#diff-3806ff11c9d923fac04777c83296a19e) that overrode this commit a489493 that fixed this issue #4540