Don't remove last char from profiling cookie path

Code was stripping last char from path when expiring the cookie that
controls profiling. For example, cookie created at /admin/info/
was being expired as /admin/info without final "/". This can fail
to find the cookie (browser dependent?) and leave profiling active
for all subsequent refreshes of the view.

Change-Id: I71d36ab3ff121cc43b8d0b43a056ba26aa030058
This commit is contained in:
Stuart Grace 2018-06-15 17:43:19 +01:00
parent 77ff5151c8
commit 3a579e643a
1 changed files with 1 additions and 1 deletions

View File

@ -137,7 +137,7 @@ class ProfilerMiddleware(object):
def clear_profiling_cookies(request, response):
"""Expire any cookie that initiated profiling request."""
if 'profile_page' in request.COOKIES:
path = request.path[:-1]
path = request.path
response.set_cookie('profile_page', max_age=0, path=path)
def process_response(self, request, response):