You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most http libraries automatically handle URI encoding of query parameters. It would be expected that PineJS is able to accept URI encoded query parameters and decode them properly, however there seem to be some weird inconsistencies about when things need to be encoded and when they don't. For example, in open-balena-api, this request gets a Malformed url response:
The difference between the two is the / in device_type_alias/any being encoded as %2f. In fact, encoding any of /, (, ), or : in the filter value results in a Malformed url response but ' can be encoded as %27 and spaces as + or %20 without issue (or even not encoded), for example all of these fail:
Most http libraries automatically handle URI encoding of query parameters. It would be expected that PineJS is able to accept URI encoded query parameters and decode them properly, however there seem to be some weird inconsistencies about when things need to be encoded and when they don't. For example, in open-balena-api, this request gets a
Malformed url
response:whereas this works fine:
The difference between the two is the
/
indevice_type_alias/any
being encoded as%2f
. In fact, encoding any of/
,(
,)
, or:
in thefilter
value results in aMalformed url
response but'
can be encoded as%27
and spaces as+
or%20
without issue (or even not encoded), for example all of these fail:I could be wrong, but the issue seems to be that this
complex url
check happens BEFORE a call todecodeURIComponent
:pinejs/src/sbvr-api/uri-parser.ts
Line 100 in ca446d9
This means that when the
/
,(
,)
, or:
are URI encoded, it skips straight to line 137 and callsparseOdata
without ever callingdecodeURIComponent
:pinejs/src/sbvr-api/uri-parser.ts
Line 137 in ca446d9
On the other path, inside the if statement, OData parsing is done with the URI decoded params:
pinejs/src/sbvr-api/uri-parser.ts
Lines 119 to 125 in ca446d9
The text was updated successfully, but these errors were encountered: