From 434a76e075d0da12919732e6b39bae98035dc4c2 Mon Sep 17 00:00:00 2001 From: Amaury Rodriguez <787616+amrod@users.noreply.github.com> Date: Tue, 31 Jul 2018 12:43:09 -0400 Subject: [PATCH] Inherit from MiddlewareMixin Inheriting from MiddlewareMixin to add support for Django new-style (1.11+) middleware. --- breach_buster/middleware/gzip.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/breach_buster/middleware/gzip.py b/breach_buster/middleware/gzip.py index ab74b17..613f202 100644 --- a/breach_buster/middleware/gzip.py +++ b/breach_buster/middleware/gzip.py @@ -1,5 +1,6 @@ from __future__ import absolute_import import re +from django.utils.deprecation import MiddlewareMixin from gzip import GzipFile from random import Random from io import BytesIO @@ -128,7 +129,7 @@ def compress_sequence(sequence): zfile.close() yield buf.read() -class GZipMiddleware(object): +class GZipMiddleware(MiddlewareMixin): """ This middleware compresses content if the browser allows gzip compression. It sets the Vary header accordingly, so that caches will base their storage