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