reyesoft / ngx-jsonapi

JSON API client library for Angular 5+ 👌 :: Production Ready 🚀
https://ngx-jsonapi.reyesoft.com/
MIT License
101 stars 52 forks source link

'&' in remotefilter is not properly URL serialized #307

Open lunarmoon26 opened 3 years ago

lunarmoon26 commented 3 years ago

Version:

2.2.1

Issue:

For example giving the following service call:

Service<Resource>.all({
  remotefilter: {
    field: "foo&bar"
  }
})

The serialized URL will be:

...?filter[field]=foo&bar

which isn't correct. The work around is to manually encrypt the string before passing to the filter. This isn't very robust as the developer may forget to do so

Solution:

URL encrypt the string field (encodeURIComponent) by default and provide an option to override?

pablorsk commented 3 years ago

Solution:

PR with jest test are welcome. On 15 days, if the problem has not been solved, @ahumadamatias will fix it (FE-261).