Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
refactor: use Uri.TryCreate and merge null-or-rooted guard in Normali…
…zePath
  • Loading branch information
thomhurst committed May 10, 2026
commit d98a3392e124c3cec9e53cd3416cc7c2c4e958ab
5 changes: 2 additions & 3 deletions TUnit.Mocks.Http/RequestMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ public RequestMatcher PathStartsWith(string prefix)

private static string NormalizePath(string value)
{
if (string.IsNullOrEmpty(value)) return value;
if (value[0] == '/') return value;
if (value.Contains("://", StringComparison.Ordinal)) return value;
if (string.IsNullOrEmpty(value) || value[0] == '/') return value;
if (Uri.TryCreate(value, UriKind.Absolute, out _)) return value;
return "/" + value;
}

Expand Down
Loading