mozilla-sensorweb / sensorthings

Node implementation of the OGC SensorThings API
Mozilla Public License 2.0
14 stars 9 forks source link

Spaces are not correctly urlDecoded when parsing the query options #236

Closed albertopq closed 7 years ago

albertopq commented 7 years ago

A request like:

Things?$filter=name lt 'thing 1' is encoded like Things%3F%24filter%3Dname%20lt%20%27thing+1%27

That results on querying 'thing+1' in the database, when we are expecting 'thing 1'. According to mdn:

For application/x-www-form-urlencoded (POST), spaces are to be replaced by '+', so one may wish to follow a encodeURIComponent replacement with an additional replacement of "%20" with "+".