about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorUltraQbik <no1skill@yandex.ru>2024-08-23 21:11:20 +0300
committerUltraQbik <no1skill@yandex.ru>2024-08-23 21:11:20 +0300
commite9f7ae54d64be673117e4cabe32badd01048bb69 (patch)
tree5781115d3577c64accc9c993ce7e51aa1421d405 /src
parenta37413d9077a6ae6c711a4583b269251a42d9257 (diff)
downloadhttpy-e9f7ae54d64be673117e4cabe32badd01048bb69.tar.gz
httpy-e9f7ae54d64be673117e4cabe32badd01048bb69.zip
Update API and response class
Diffstat (limited to 'src')
-rw-r--r--src/APIv1.py2
-rw-r--r--src/request.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/APIv1.py b/src/APIv1.py
index c9ba2da..f163c5b 100644
--- a/src/APIv1.py
+++ b/src/APIv1.py
@@ -78,7 +78,7 @@ def api_call(client: SSLSocket, request: Request) -> Response:
             if size < API_FILE_RANDOM_MIN_SIZE_LIMIT or size > API_FILE_RANDOM_MAX_SIZE_LIMIT:
                 return Response(b'', STATUS_CODE_BAD_REQUEST)
 
-            return Response(random_data_gen(size), STATUS_CODE_OK)
+            return Response(random_data_gen(size), STATUS_CODE_OK, compress=False)
         else:
             return Response(b'', STATUS_CODE_BAD_REQUEST)
     else:
diff --git a/src/request.py b/src/request.py
index 28d7c14..df0d433 100644
--- a/src/request.py
+++ b/src/request.py
@@ -72,4 +72,4 @@ class Response:
         self.data: bytes = data
         self.status: StatusCode = status
         self.headers: dict[str, Any] = headers if headers is not None else dict()
-        self.compress: bool = kwargs.get("compress", False)
+        self.compress: bool = kwargs.get("compress", True)