diff --git a/lib/Logitar.Identity.Core/Url.cs b/lib/Logitar.Identity.Core/Url.cs
index 554ad66..ed6d0a1 100644
--- a/lib/Logitar.Identity.Core/Url.cs
+++ b/lib/Logitar.Identity.Core/Url.cs
@@ -30,11 +30,8 @@ public record Url
/// Initializes a new instance of the class.
///
/// The Uniform Resource Identifier (URI) object.
- public Url(Uri uri)
+ public Url(Uri uri) : this(uri.ToString())
{
- Uri = uri;
- Value = uri.ToString();
- new Validator().ValidateAndThrow(this);
}
///
/// Initializes a new instance of the class.
@@ -42,10 +39,10 @@ public Url(Uri uri)
/// A string representation of an Uniform Resource Identifier (URI).
public Url(string value)
{
- Value = value;
+ Value = value.Trim();
new Validator().ValidateAndThrow(this);
- Uri = new Uri(value, UriKind.Absolute);
+ Uri = new Uri(Value, UriKind.Absolute);
}
///