Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no escaping in json keys /sql?mode=raw #764

Closed
githubmanticore opened this issue Apr 14, 2022 · 1 comment
Closed

no escaping in json keys /sql?mode=raw #764

githubmanticore opened this issue Apr 14, 2022 · 1 comment
Labels

Comments

@githubmanticore
Copy link
Contributor

/sql?mode=raw can return invalid JSON due to the lack of escaping of keys, e.g. http://localhost:9308/sql?mode=raw&query=select%20concat(%27%22%27,%20%27a%27)

[{ 
"columns":[{"concat('"', 'a')":{"type":"string"}}], 
"data":[ 
{"concat('"', 'a')":"\"a"} 
], 
"total":1, 
"error":"", 
"warning":"" 
}] 

The task is to add escaping. As discussed with Alexey it can cause slower response rendering, but I find it ok since /sql?mode=raw shouldn't be used for things where it's critical to have as fast rendering as possible (select/insert/replace/update/delete).

@sanikolaev
Copy link
Collaborator

fixed in 36efc60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants