From fcccab684d61d9c428fd9b862db14dd9da5a0e38 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Tue, 29 Oct 2019 16:15:07 +0100 Subject: [PATCH] simplify condition --- mitmproxy/addons/export.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mitmproxy/addons/export.py b/mitmproxy/addons/export.py index cc698f9c0..2776118ab 100644 --- a/mitmproxy/addons/export.py +++ b/mitmproxy/addons/export.py @@ -17,9 +17,7 @@ def cleanup_request(f: flow.Flow): request = f.request.copy() # type: ignore request.decode(strict=False) # a bit of clean-up - if ('content-length' in request.headers.keys() and - request.headers['content-length'] == '0' and - request.method == 'GET'): + if request.method == 'GET' and request.headers.get("content-length", None) == "0": request.headers.pop('content-length') request.headers.pop(':authority', None) return request