Skip to content

Commit

Permalink
ensure uri can be created from string before validation (#587)
Browse files Browse the repository at this point in the history
  • Loading branch information
acn-sbuad authored Aug 13, 2024
1 parent e6784e2 commit 0fef6c9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Altinn.Notifications/Extensions/UriExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ public static class UriExtensions
/// </summary>
public static bool IsValidUrl(this Uri uri)
{
if (!Uri.TryCreate(uri.ToString(), UriKind.Absolute, out _))
{
return false;
}

if (uri.Scheme != "http" && uri.Scheme != "https")
{
return false;
Expand Down

0 comments on commit 0fef6c9

Please sign in to comment.