From dc2a34b48b99a7ca25c480f647566c5d0d2ac340 Mon Sep 17 00:00:00 2001 From: Francis Pion Date: Mon, 23 Dec 2024 20:04:20 -0500 Subject: [PATCH] Fixed Url. --- lib/Logitar.Identity.Core/Url.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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); } ///