Skip to content

Commit

Permalink
include select with newline in clickhouse queries
Browse files Browse the repository at this point in the history
Signed-off-by: jnichols <mail@jnichols.info>
  • Loading branch information
jnichols-git committed Jan 10, 2024
1 parent f31766c commit 55936b6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/backends/clickhouse/handler_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ func (c *Client) QueryHandler(w http.ResponseWriter, r *http.Request) {
r = request.SetBody(r, body)
}
sqlQuery = strings.ToLower(sqlQuery)
if (!strings.HasPrefix(sqlQuery, "select ")) && (!(strings.Index(sqlQuery, " select ") > 0)) {
if !(strings.HasPrefix(sqlQuery, "select ") ||
strings.HasPrefix(sqlQuery, "select\n") ||
strings.Contains(sqlQuery, " select ")) {
c.ProxyHandler(w, r)
return
}
Expand Down

0 comments on commit 55936b6

Please sign in to comment.