Skip to content

Unnecessary url decoding for cli_json requests #1866

Closed
@Nick-S-2018

Description

@Nick-S-2018

We say in the documentation that requests to the cli_json endpoint do not require url-encoding. But we still always url-decode them on the server side which can be seen from the example below.

 curl localhost:9308/cli_json -d 'SELECT%20%2A%20FROM%20test'

[{
"columns":[{"id":{"type":"long long"}},{"f":{"type":"text"}}],
"data":[

],
"total":0,
"error":"",
"warning":""
}

In some cases, this behavior can also lead to errors:

curl localhost:9308/cli_json -d "SELECT * FROM test WHERE MATCH('%2F')"

[{"total":0,"warning":"","error":"index document_chunk: P08: syntax error, unexpected '/' near '/'"}]

The possible solution would be to perform decoding only for the queries passed in the query string which actually need it, but not for the ones passed in the request body. Also we would need to update the documentation appropriately.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions