Skip to content
This repository was archived by the owner on Dec 29, 2023. It is now read-only.

Commit 04ff15c

Browse files
authored
Strip query for safety
1 parent f56e1d3 commit 04ff15c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def clickhouse():
5656
if database:
5757
query = f"USE {database}; {query}".encode()
5858

59-
result, errmsg = chdb_query_with_errmsg(query, format)
59+
result, errmsg = chdb_query_with_errmsg(query.strip(), format)
6060
if len(errmsg) == 0:
6161
return result, 200
6262
return errmsg, 400
@@ -83,7 +83,7 @@ def play():
8383
database = f"USE {database}; ".encode()
8484
query = database + query
8585

86-
result, errmsg = chdb_query_with_errmsg(query, format)
86+
result, errmsg = chdb_query_with_errmsg(query.strip(), format)
8787
if len(errmsg) == 0:
8888
return result, 200
8989
return errmsg, 400

0 commit comments

Comments
 (0)