chore: lint

This commit is contained in:
Rebecca Graber
2021-09-30 12:12:29 -04:00
parent 9e44714f4a
commit 8454c5bfcb

View File

@@ -23,7 +23,7 @@ COURSE_REGEX = re.compile(fr'^(.*?/courses/)(?!v[0-9]+/[^/]+){settings.COURSE_ID
# .. toggle_name: request_utils.capture_cookie_sizes
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Enables detailed capturing of cookie sizes for monitoring purposes. This can be useful for tracking
# .. toggle_description: Enables more detailed capturing of cookie sizes for monitoring purposes. This can be useful for tracking
# down large cookies if requests are nearing limits on the total size of cookies. See the CookieMonitoringMiddleware
# docstring for details on the monitoring custom attributes that will be set.
# .. toggle_warnings: Enabling this flag will add a number of custom attributes, and could adversely affect other
@@ -146,10 +146,9 @@ class CookieMonitoringMiddleware(MiddlewareMixin):
"""
if (request.META.get('HTTP_COOKIE', None)):
if request.META.get('HTTP_COOKIE', None):
set_custom_attribute('cookies.header.size', len(request.META['HTTP_COOKIE'].encode('utf-8')))
if not CAPTURE_COOKIE_SIZES.is_enabled():
return