about summary refs log tree commit diff
path: root/main.py
diff options
context:
space:
mode:
authorUltraQbik <no1skill@yandex.ru>2024-08-23 21:14:48 +0300
committerUltraQbik <no1skill@yandex.ru>2024-08-23 21:14:48 +0300
commit9afb912c6471376cbc4907b58ec2904fceb0a797 (patch)
tree5d64e0bc4e7ac748a4d4393c6cb0660a7f802a5e /main.py
parent9b5c0ee8f79b24a0a269be2a9984dc09244fd278 (diff)
downloadhttpy-9afb912c6471376cbc4907b58ec2904fceb0a797.tar.gz
httpy-9afb912c6471376cbc4907b58ec2904fceb0a797.zip
Update compression thing
Diffstat (limited to 'main.py')
-rw-r--r--main.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/main.py b/main.py
index de605b6..755da18 100644
--- a/main.py
+++ b/main.py
@@ -144,7 +144,7 @@ class HTTPServer:
                 response = Response(data, STATUS_CODE_NOT_FOUND)
 
         # process header data
-        if response.headers.get("Content-Encoding") is None:
+        if response.headers.get("Content-Encoding") is None and response.compress:
             supported_compressions = [x.strip() for x in getattr(request, "Accept-Encoding", "").split(",")]
             if "br" in supported_compressions:
                 response.headers["Content-Encoding"] = "br"