diff --git a/BrowseRouter/Infrastructure/AssemblyInfo.cs b/BrowseRouter/Infrastructure/AssemblyInfo.cs
index c3d40b9..d1eea1d 100644
--- a/BrowseRouter/Infrastructure/AssemblyInfo.cs
+++ b/BrowseRouter/Infrastructure/AssemblyInfo.cs
@@ -1,3 +1,3 @@
using System.Runtime.CompilerServices;
-[assembly: InternalsVisibleTo("BrowserRouter.Tests")]
+[assembly: InternalsVisibleTo("BrowseRouter.Tests")]
diff --git a/BrowseRouter/Model/UriFactory.cs b/BrowseRouter/Model/UriFactory.cs
index 4823d43..f3fe14d 100644
--- a/BrowseRouter/Model/UriFactory.cs
+++ b/BrowseRouter/Model/UriFactory.cs
@@ -1,4 +1,6 @@
-namespace BrowseRouter.Model;
+using System.Net;
+
+namespace BrowseRouter.Model;
public static class UriFactory
{
@@ -6,7 +8,7 @@ public static Uri Get(string url)
{
try
{
- return new Uri(url);
+ return new Uri(WebUtility.UrlDecode(url));
}
catch (UriFormatException)
{
diff --git a/Directory.Build.props b/Directory.Build.props
index d22e3cc..4ebdcb2 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -5,7 +5,7 @@
enable
enable
latest
- 0.15.2
+ 0.15.3
BrowseRouter
EnduraByte LLC 2025
diff --git a/Tests/BrowseRouter.Tests/Model/UriFactoryTests.cs b/Tests/BrowseRouter.Tests/Model/UriFactoryTests.cs
new file mode 100644
index 0000000..43376c7
--- /dev/null
+++ b/Tests/BrowseRouter.Tests/Model/UriFactoryTests.cs
@@ -0,0 +1,33 @@
+using BrowseRouter.Model;
+
+namespace BrowseRouter.Tests.Model;
+
+public class GetMethod
+{
+ [Fact]
+ public void HandlesValidUrl()
+ {
+ string url = "https://www.example.com/path";
+ var act = () => UriFactory.Get(url);
+
+ act.Should().NotThrow();
+ }
+
+ [Fact]
+ public void HandlesUrlWithoutHttps()
+ {
+ string url = "www.example.com/path";
+ var act = () => UriFactory.Get(url);
+
+ act.Should().NotThrow();
+ }
+
+ [Fact]
+ public void HandlesUrlEncodedUrl()
+ {
+ string url = "https%3A%2F%2Fwww.example.com%2Fpath%2F";
+ var act = () => UriFactory.Get(url);
+
+ act.Should().NotThrow();
+ }
+}