mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-15 00:30:33 +03:00
fix gzip support in debug_webserver
This commit is contained in:
parent
d6dcebf545
commit
38f35403c9
@ -1,4 +1,5 @@
|
|||||||
"""Simple HTTP listener to be used with debugging various EDMC sends."""
|
"""Simple HTTP listener to be used with debugging various EDMC sends."""
|
||||||
|
import gzip
|
||||||
import json
|
import json
|
||||||
import pathlib
|
import pathlib
|
||||||
import tempfile
|
import tempfile
|
||||||
@ -36,7 +37,10 @@ class LoggingHandler(server.BaseHTTPRequestHandler):
|
|||||||
|
|
||||||
encoding = self.headers.get('Content-Encoding')
|
encoding = self.headers.get('Content-Encoding')
|
||||||
|
|
||||||
if encoding in ('gzip', 'deflate'):
|
if encoding == 'gzip':
|
||||||
|
data = gzip.decompress(data_raw).decode('utf-8', errors='replace')
|
||||||
|
|
||||||
|
elif encoding == 'deflate':
|
||||||
data = zlib.decompress(data_raw).decode('utf-8', errors='replace')
|
data = zlib.decompress(data_raw).decode('utf-8', errors='replace')
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user