From 85d8fc4a752ed4238408148a96c2f9c29440123f Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Wed, 5 Jul 2017 15:23:43 +0400 Subject: [PATCH 1/2] Brotli --- hyper/http20/response.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hyper/http20/response.py b/hyper/http20/response.py index 280ffbb2..fab7805f 100644 --- a/hyper/http20/response.py +++ b/hyper/http20/response.py @@ -34,6 +34,12 @@ def strip_headers(headers): b'deflate': DeflateDecoder } +try: + import brotli + decompressors[b"br"] = brotli.Decompressor +except ImportError: + pass + class HTTP20Response(object): """ From 1bb3f1d94cec01326101096d000326f7ee793071 Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Wed, 5 Jul 2017 15:27:19 +0400 Subject: [PATCH 2/2] Update setup.py --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 861c883a..d92a67e0 100644 --- a/setup.py +++ b/setup.py @@ -87,6 +87,7 @@ def run_tests(self): ], }, extras_require={ + 'brotli': ['brotlipy'], 'fast': ['pycohttpparser'], # Fallback to good SSL on bad Python versions. ':python_full_version < "2.7.9"': [