From 3e8102221d794ab67e8d1c85d8cef47a086da5fa Mon Sep 17 00:00:00 2001 From: Barbara Miller Date: Wed, 3 Aug 2022 14:59:36 -0700 Subject: [PATCH] use 'compressed_blocks' --- warcprox/warcproxy.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/warcprox/warcproxy.py b/warcprox/warcproxy.py index 2034ec0..be2affd 100644 --- a/warcprox/warcproxy.py +++ b/warcprox/warcproxy.py @@ -176,9 +176,10 @@ class WarcProxyHandler(warcprox.mitmproxy.MitmProxyHandler): warcprox_meta = json.loads(self.headers['Warcprox-Meta']) self._security_check(warcprox_meta) self._enforce_limits(warcprox_meta) - if 'blocks' in warcprox_meta: - warcprox_meta['blocks'] = zlib.decompress(warcprox_meta['blocks']).decode() - self._enforce_blocks(warcprox_meta) + if 'compressed_blocks' in warcprox_meta: + warcprox_meta['blocks'] = zlib.decompress(warcprox_meta['compressed_blocks']).decode() + del warcprox_meta['compressed_blocks'] + self._enforce_blocks(warcprox_meta) def _connect_to_remote_server(self): '''