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): """ 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"': [