perf: 修复 middleware 导致的内存增长

pull/8490/head v2.22.4
ibuler 2022-06-25 10:14:13 +08:00 committed by 老广
parent 052b35ed97
commit fadeeaee49
1 changed files with 2 additions and 0 deletions

View File

@ -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)