fix #4091 - double slash generated for home page path ("/") and urlparameters

This commit is contained in:
sbwalker 2024-04-01 15:11:20 -04:00
parent 9843dccdf0
commit e600da229c

View File

@ -80,8 +80,8 @@ namespace Oqtane.Shared
// add urlparameters to path // add urlparameters to path
if (!string.IsNullOrEmpty(urlparameters)) if (!string.IsNullOrEmpty(urlparameters))
{ {
if (urlparameters.StartsWith("/")) urlparameters = urlparameters.Remove(0, 1); if (urlparameters.StartsWith("/")) urlparameters = urlparameters.Substring(1);
path += $"/{Constants.UrlParametersDelimiter}/{urlparameters}"; path += (path.EndsWith("/") ? "" : "/") + $"{Constants.UrlParametersDelimiter}/{urlparameters}";
} }
// build url // build url