mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-14 16:27:13 +03:00
drop match statement
This commit is contained in:
parent
ec6f333cfa
commit
1c190dd76f
@ -35,15 +35,13 @@ class LoggingHandler(server.BaseHTTPRequestHandler):
|
|||||||
data_raw: bytes = self.rfile.read(int(self.headers['Content-Length']))
|
data_raw: bytes = self.rfile.read(int(self.headers['Content-Length']))
|
||||||
data: str | bytes
|
data: str | bytes
|
||||||
|
|
||||||
match self.headers.get('Content-Encoding'):
|
encoding = self.headers.get('Content-Encoding')
|
||||||
case 'gzip':
|
|
||||||
data = gzip.decompress(data_raw).decode('utf-8', errors='replace')
|
|
||||||
|
|
||||||
case 'deflate':
|
if encoding in ('gzip', 'deflate'):
|
||||||
zlib.decompress(data_raw).decode('utf-8', errors='replace')
|
data = zlib.decompress(data_raw).decode('utf-8', errors='replace')
|
||||||
|
|
||||||
case _:
|
else:
|
||||||
data = data_raw.decode('utf-8', errors='replace')
|
data = data_raw.decode('utf-8', errors='replace')
|
||||||
|
|
||||||
to_save = data
|
to_save = data
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user