Project

General

Profile

Actions

Bug #10915

closed

No clear error message when calling api with curl and data are not url-encoded

Added by I C over 7 years ago. Updated over 2 years ago.

Status:
Released
Priority:
N/A
Category:
API
Target version:
Severity:
Minor - inconvenience | misleading | easy workaround
UX impact:
User visibility:
Infrequent - complex configurations | third party integrations
Effort required:
Priority:
21
Name check:
Fix check:
Checked
Regression:

Description

Hi,

It seems that there is a problem when parsing parameters in curl requests :
curl -s -k -X GET -H "X-API-Token:mytoken" 'https://rudder-server/rudder/api/latest/nodes?where=\[\{"objectType":"serializedNodeProperty","attribute":"name.value","comparator":"regex","value":"ref=vm2345"\}\]' {"action":"listAcceptedNodes","result":"error","errorDetails":"error with query"}

'ref=vm' is parsed as a query parameter by the web framework and break the query.

With %3D in place of = it works :
curl -s -k -X GET -H "X-API-Token:mytoken" 'https://rudder-server/rudder/api/latest/nodes?where=\[\{"objectType":"serializedNodeProperty","attribute":"name.value","comparator":"regex","value":"ref%3Dvm2345"\}\]' {
"action": "listAcceptedNodes",
"result": "success",
"data": {
"nodes": [ {
"id": "5573be84-d36e-4d98-b72f-17abe3963d33",
"hostname": "rudder-agent1.novalocal",
"status": "accepted",
"os": {
"type": "Linux",
"name": "Debian",
"version": "8.8",
"fullName": "Debian GNU/Linux 8.8 (jessie)",
"kernelVersion": "3.16.0-4-amd64"
},
"architectureDescription": "x86_64-linux-thread-multi",
"ram": 2010,
"machine": {
"id": "f9660688-95dd-8bc5-eca8-52fa68acff88",
....

Actions

Also available in: Atom PDF