Skip to content

Commit

Permalink
Trim slashes.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahelsaig committed Feb 25, 2023
1 parent b5ac8bb commit 881d922
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public ResourceFilter When(Func<HttpContext, Task<bool>> filterAsync)
/// Adds a filter that matches the given <paramref name="path"/> to the list of <see cref="ResourceFilters"/>.
/// </summary>
public ResourceFilter WhenPath(string path) =>
When(context => context.Request.Path.Value?.EqualsOrdinalIgnoreCase(path) == true);
When(context => context.Request.Path.Value?.Trim('/').EqualsOrdinalIgnoreCase(path.Trim('/')) == true);

/// <summary>
/// Adds a filter that matches the path of the homepage (<c>"/"</c>) to the list of <see cref="ResourceFilters"/>.
Expand Down

0 comments on commit 881d922

Please sign in to comment.