From d352df384605058f59f9b68a84e4034e27ffd21e Mon Sep 17 00:00:00 2001 From: wangxu <1318272526@qq.com> Date: Wed, 13 May 2026 18:52:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8E=A5=E5=8F=A3=E5=93=8D?= =?UTF-8?q?=E5=BA=94=E9=80=9F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views_task.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/views_task.py b/app/views_task.py index d632db0..99ecce2 100644 --- a/app/views_task.py +++ b/app/views_task.py @@ -233,7 +233,18 @@ def test_split_api(): @app.route('/api/do_distribute_cross', methods=['POST']) def do_distribute_cross(): - return distribute_cross(request.get_json()) + res = distribute_cross(request.get_json()) + # 手动gzip压缩 + compressed_data = gzip.compress(res.encode('utf-8'), compresslevel=6) + + return Response( + compressed_data, + headers={ + 'Content-Encoding': 'gzip', + 'Content-Type': 'application/json', + 'Content-Length': str(len(compressed_data)) + } + ) @app.route('/api/cross_monitor_record_info', methods=['GET'])