Skip to content

Commit cee6aa9

Browse files
committed
Addressed issue with root path.
1 parent dcee975 commit cee6aa9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Geta.Optimizely.Sitemaps/Utils/UrlFilter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ private static bool IsMatch(string url, string path)
5353

5454
private static string Normalize(string value)
5555
{
56-
var transformedValue = value.ToLower().Trim().TrimStart('/').TrimEnd('/');
56+
var transformedValue = value?.ToLower().Trim().TrimStart('/').TrimEnd('/');
5757

58-
return $"/{transformedValue}/";
58+
return string.IsNullOrWhiteSpace(transformedValue) ? "/" : $"/{transformedValue}/";
5959
}
6060
}
6161
}

0 commit comments

Comments
 (0)