about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUltraQbik <no1skill@yandex.ru>2024-08-24 19:51:04 +0300
committerUltraQbik <no1skill@yandex.ru>2024-08-24 19:51:04 +0300
commit443b0216eec676360f9b835607301c3d7fd427d3 (patch)
tree1fde5805c61d77f854acaf43c31936ed11232b41
parentb23b31926bef9447cd2eede4dc160fd922576488 (diff)
downloadhttpy-443b0216eec676360f9b835607301c3d7fd427d3.tar.gz
httpy-443b0216eec676360f9b835607301c3d7fd427d3.zip
Add HTML minimizer
-rw-r--r--main.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/main.py b/main.py
index db3a716..97f53d0 100644
--- a/main.py
+++ b/main.py
@@ -178,6 +178,9 @@ class HTTPServer:
             with open(filepath, "rb") as file:
                 data = file.read()
 
+            if filepath[-4:] == "html":
+                data = minimize_html(data)
+
             if request.type == "GET":
                 return Response(data, STATUS_CODE_OK)
             elif request.type == "HEAD":