From bf2b7909d55e8ec277c94070eeb0f1786faf970f Mon Sep 17 00:00:00 2001 From: EvildoerXiaoyy Date: Tue, 19 Apr 2022 20:28:59 +0800 Subject: [PATCH] =?UTF-8?q?optimization:=20=E4=BC=98=E5=8C=96esb=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=E5=A4=A7=E6=95=B0=E6=8D=AE=E9=87=8F=E7=BC=93=E6=85=A2?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/log_esquery/views/esquery_views.py | 2 +- config/default.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/log_esquery/views/esquery_views.py b/apps/log_esquery/views/esquery_views.py index 8821e33ac..13a371833 100644 --- a/apps/log_esquery/views/esquery_views.py +++ b/apps/log_esquery/views/esquery_views.py @@ -220,7 +220,7 @@ def search(self, request): data = self.params_valid(EsQuerySearchAttrSerializer) # 调用EsQuery实例 esquery = EsQuery(data) - return Response(esquery.search()) + return Response(esquery.search(), headers={"Content-Type": "application/json;charset=UTF-8"}) @list_route(methods=["POST"], url_path="dsl/") def dsl(self, request): diff --git a/config/default.py b/config/default.py index 73eff853d..a7e9246a5 100644 --- a/config/default.py +++ b/config/default.py @@ -81,6 +81,7 @@ # 如果你已经了解每个默认 MIDDLEWARE 的作用,确实需要去掉某些 MIDDLEWARE,或者改动先后顺序,请去掉下面的注释,然后修改 MIDDLEWARE = ( # request instance provider + "django.middleware.gzip.GZipMiddleware", "blueapps.middleware.request_provider.RequestProvider", "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.common.CommonMiddleware",