From 61029c013840b3ef284e66e099719ffc330c4c0c Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Thu, 16 Nov 2017 20:23:05 -0800 Subject: [PATCH] Use Google's 'brotli' module, not the 'brotlipy' one I cannot figure for the life of me what the point of the 'brotlipy' wrapper that upstream depends on is. The 'brotli' module from Google's Brotli distribution appears to provide everything httpbin uses. So, let's use that, not brotlipy. --- httpbin/filters.py | 4 ++-- setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/httpbin/filters.py b/httpbin/filters.py index c6268b6..f3bff16 100644 --- a/httpbin/filters.py +++ b/httpbin/filters.py @@ -10,7 +10,7 @@ This module provides response filter decorators. import gzip as gzip2 import zlib -import brotli as _brotli +import brotli as _origbrotli from six import BytesIO from decimal import Decimal @@ -103,7 +103,7 @@ def brotli(f, *args, **kwargs): else: content = data - deflated_data = _brotli.compress(content) + deflated_data = _origbrotli.compress(content) if isinstance(data, Response): data.data = deflated_data diff --git a/setup.py b/setup.py index e1cf8af..c0e2d8b 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ setup( packages=find_packages(), include_package_data = True, # include files listed in MANIFEST.in install_requires=[ - 'Flask', 'MarkupSafe', 'decorator', 'itsdangerous', 'six', 'brotlipy', + 'Flask', 'MarkupSafe', 'decorator', 'itsdangerous', 'six', 'brotli', 'raven[flask]', 'werkzeug>=0.14.1' ], ) -- 2.14.3