Breeze / breeze.server.net

Breeze support for .NET servers
MIT License
76 stars 62 forks source link

.NET Core QueryFilter issue when inner query contains '&' #78

Closed copo closed 5 years ago

copo commented 5 years ago

There's an issue with QueryFilter when it tries to decode a query string with inner contents containing an ampersand (&), e.g.

?{"where":{"CompanyName":{"contains":"Bob&Larry's Garage"}}}?anotherParameter=1

The ExtractAndDecodeQueryString method in QueryFns finds the first instance of an '&' in the query string and cuts off everything after that first instance, which I assume is to remove any additional parameters, such as 'anotherParameter' above. However, given the example above, it returns:

?{"where":{"CompanyName":{"contains":"Bob

QueryFilter blows up a few lines later when it passes this string to the EntityQuery constructor, which tries to deserialize the above as json.

Also, escaping the '&' doesn't really get us anywhere as there's no place where it is un-escaped.

jtraband commented 5 years ago

good catch, I'll take a look

jtraband commented 5 years ago

ok, I just put up a fix on Nuget ( and GitHub). Nuget version is 1.0.3.1. and again thanks for the catch.

copo commented 5 years ago

Thanks, much appreciated!