diff --git a/Rest.Net.Tests/RouteMatcherTests.cs b/Rest.Net.Tests/RouteMatcherTests.cs index 8b36a2d..caf91e4 100644 --- a/Rest.Net.Tests/RouteMatcherTests.cs +++ b/Rest.Net.Tests/RouteMatcherTests.cs @@ -69,6 +69,14 @@ namespace MontoyaTech.Rest.Net.Tests arguments[1].Should().Be("2"); } + [Fact] + public void SyntaxWithArgumentsUrlEncodedShouldDecode() + { + RouteMatcher.Matches("http://localhost/a/b%20c", "/a/{name}", out string[] arguments).Should().BeTrue(); + arguments.Length.Should().Be(1); + arguments[0].Should().Be("b c"); + } + [Fact] public void SyntaxWithWildcardShouldMatch() { diff --git a/Rest.Net/Rest.Net.csproj b/Rest.Net/Rest.Net.csproj index aefd13a..34bfb69 100644 --- a/Rest.Net/Rest.Net.csproj +++ b/Rest.Net/Rest.Net.csproj @@ -17,7 +17,7 @@ MontoyaTech.Rest.Net MontoyaTech.Rest.Net True - 1.1.7 + 1.1.8 Logo_Symbol_Black_Outline.png diff --git a/Rest.Net/RouteMatcher.cs b/Rest.Net/RouteMatcher.cs index 559ebd1..9f5ab98 100644 --- a/Rest.Net/RouteMatcher.cs +++ b/Rest.Net/RouteMatcher.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Net; namespace MontoyaTech.Rest.Net { @@ -121,7 +122,7 @@ namespace MontoyaTech.Rest.Net } else if (condition.StartsWith("{") && condition.EndsWith("}")) { - arguments[argumentIndex++] = urlSegment; + arguments[argumentIndex++] = WebUtility.UrlDecode(urlSegment); match = true; }