1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 07:47:14 +03:00

drop match statement

This commit is contained in:
A_D 2022-01-25 17:11:23 +02:00
parent ec6f333cfa
commit 1c190dd76f
No known key found for this signature in database
GPG Key ID: 4BE9EB7DF45076C4

View File

@ -35,15 +35,13 @@ class LoggingHandler(server.BaseHTTPRequestHandler):
data_raw: bytes = self.rfile.read(int(self.headers['Content-Length']))
data: str | bytes
match self.headers.get('Content-Encoding'):
case 'gzip':
data = gzip.decompress(data_raw).decode('utf-8', errors='replace')
encoding = self.headers.get('Content-Encoding')
case 'deflate':
zlib.decompress(data_raw).decode('utf-8', errors='replace')
if encoding in ('gzip', 'deflate'):
data = zlib.decompress(data_raw).decode('utf-8', errors='replace')
case _:
data = data_raw.decode('utf-8', errors='replace')
else:
data = data_raw.decode('utf-8', errors='replace')
to_save = data