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

Commit b5705f6

Browse files
author
root
committed
2 parents 9f2248c + 3a4ed23 commit b5705f6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

main.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ def clickhouse():
5858

5959
result, errmsg = chdb_query_with_errmsg(query, format)
6060
if len(errmsg) == 0:
61-
return result
62-
return errmsg
61+
return result, 200
62+
return errmsg, 400
6363

6464
@app.route('/', methods=["POST"])
6565
@auth.login_required
6666
def play():
67-
query = request.data or None
67+
query = request.get_data() or None
6868
format = request.args.get('default_format', default="TSV", type=str)
6969
database = request.args.get('database', default="", type=str)
7070
if not query:
@@ -76,8 +76,8 @@ def play():
7676

7777
result, errmsg = chdb_query_with_errmsg(query, format)
7878
if len(errmsg) == 0:
79-
return result
80-
return errmsg
79+
return result, 200
80+
return errmsg, 400
8181

8282

8383
@app.route('/play', methods=["GET"])

0 commit comments

Comments
 (0)