Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Commit 26bbe46

Browse files
authored
Fixed Url. (#81)
1 parent 5f3a758 commit 26bbe46

File tree

1 file changed

+3
-6
lines changed
  • lib/Logitar.Identity.Core

1 file changed

+3
-6
lines changed

lib/Logitar.Identity.Core/Url.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,19 @@ public record Url
3030
/// Initializes a new instance of the <see cref="Url"/> class.
3131
/// </summary>
3232
/// <param name="uri">The Uniform Resource Identifier (URI) object.</param>
33-
public Url(Uri uri)
33+
public Url(Uri uri) : this(uri.ToString())
3434
{
35-
Uri = uri;
36-
Value = uri.ToString();
37-
new Validator().ValidateAndThrow(this);
3835
}
3936
/// <summary>
4037
/// Initializes a new instance of the <see cref="Url"/> class.
4138
/// </summary>
4239
/// <param name="value">A string representation of an Uniform Resource Identifier (URI).</param>
4340
public Url(string value)
4441
{
45-
Value = value;
42+
Value = value.Trim();
4643
new Validator().ValidateAndThrow(this);
4744

48-
Uri = new Uri(value, UriKind.Absolute);
45+
Uri = new Uri(Value, UriKind.Absolute);
4946
}
5047

5148
/// <summary>

0 commit comments

Comments
 (0)