Skip to content

Commit

Permalink
Decoded URL in LinqToQueryableAttribute. This fixes issues with encod…
Browse files Browse the repository at this point in the history
  • Loading branch information
ccoulson committed Mar 5, 2015
1 parent 5fd8378 commit 7e44064
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions LinqToQuerystring.WebApi/LinqToQueryableAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
using System.Net;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Web;
using System.Web.Http.Filters;

using ActionFilterAttribute = System.Web.Http.Filters.ActionFilterAttribute;

public class LinqToQueryableAttribute : ActionFilterAttribute
Expand All @@ -29,7 +29,7 @@ public override void OnActionExecuted(HttpActionExecutedContext actionExecutedCo

if (originalquery != null)
{
var queryString = actionExecutedContext.Request.RequestUri.Query;
var queryString = HttpUtility.UrlDecode(actionExecutedContext.Request.RequestUri.Query);
var genericType = originalquery.GetType().GetGenericArguments()[0];

var reply = originalquery.LinqToQuerystring(genericType, queryString, this.forceDynamicProperties, this.maxPageSize);
Expand Down
1 change: 1 addition & 0 deletions LinqToQuerystring.WebApi/LinqToQuerystring.WebApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<Reference Include="System.Core" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Web" />
<Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
</ItemGroup>
<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions LinqToQuerystring.WebApi/LinqToQuerystring.WebApi2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.0.0\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Http, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.0.0\lib\net45\System.Web.Http.dll</HintPath>
Expand Down

0 comments on commit 7e44064

Please sign in to comment.