From bb5b390d1db79def54987c1e640a25e1f730a7c5 Mon Sep 17 00:00:00 2001 From: ibuler Date: Sat, 25 Jun 2022 10:14:13 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E5=A4=8D=20middleware=20?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=E5=86=85=E5=AD=98=E5=A2=9E=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/authentication/middleware.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/authentication/middleware.py b/apps/authentication/middleware.py index f1f60bbc5..b4241f12d 100644 --- a/apps/authentication/middleware.py +++ b/apps/authentication/middleware.py @@ -46,6 +46,8 @@ class SessionCookieMiddleware(MiddlewareMixin): @staticmethod def set_cookie_public_key(request, response): + if request.path.startswith('/api'): + return pub_key_name = settings.SESSION_RSA_PUBLIC_KEY_NAME public_key = request.session.get(pub_key_name) cookie_key = request.COOKIES.get(pub_key_name)