Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public override bool IsValid(object? value)
{
switch (value)
{
case Uri valueAsUri:
case Uri valueAsUri when valueAsUri.IsAbsoluteUri:
{
return valueAsUri.Scheme == Uri.UriSchemeHttp
|| valueAsUri.Scheme == Uri.UriSchemeHttps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ protected override IEnumerable<TestCase> InvalidValues()
yield return new TestCase(new UrlAttribute(), new object());
yield return new TestCase(new UrlAttribute(), new Uri("file:///foo.bar"));
yield return new TestCase(new UrlAttribute(), new Uri("//foo.png"));
yield return new TestCase(new UrlAttribute(), new Uri("/foo.png", UriKind.RelativeOrAbsolute));
yield return new TestCase(new UrlAttribute(), new Uri("foo.png", UriKind.Relative));
}

[Fact]
Expand Down
Loading