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
Fix erroneous requests due to HTTP-specific settings (#497)
# Description
The new `verb` HTTP specific option was handled by the SDK controllers, impacting all protocols, including WebSocket and MQTT
Impacted routes: `document:mGet` and `security:mGetUsers`
Those 2 routes send the `ids` argument to Kuzzle as a string, instead sending it as an array.
Fortunately, Kuzzle makes no difference between requests sent using HTTP or WebSocket or any other protocol, and it sanitizes the request in such a way that this bug is invisible to common users.
But documents aren't sanitized the same way when the API route is invoked by a plugin. And when that happens, the two routes mentioned earlier make any plugin invoking them crash.
This PR removes any specificities from the SDK controllers and, instead, makes the HTTP protocol handle the new `verb` option itself.
To do that, it simply converts any `body` object provided to a querystring if the selected API route uses the `GET` method. The conversion code was already there, it just needed a small fix when converting arrays (that conversion was never used before).
# Other changes
* Dependencies update
* Migrate the deprecate `mocha.opts` file to `.mocharc.json`
* Fix documentation deadlinks
# How to reproduce
Create a small plugin, and invoke `document:mGet` using `this.context.sdk.document.mGet`
The following error ensues: `Wrong type for argument "ids" (expected: array)`
0 commit comments