diff options
author | Maximilian Hils <git@maximilianhils.com> | 2019-10-29 16:15:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-29 16:15:07 +0100 |
commit | fcccab684d61d9c428fd9b862db14dd9da5a0e38 (patch) | |
tree | 305036f212ac810a78a45294966128f858921e57 | |
parent | 6da1db750c7fc105d1d312fe6520e1b1f9d32567 (diff) | |
download | mitmproxy-fcccab684d61d9c428fd9b862db14dd9da5a0e38.tar.gz mitmproxy-fcccab684d61d9c428fd9b862db14dd9da5a0e38.tar.bz2 mitmproxy-fcccab684d61d9c428fd9b862db14dd9da5a0e38.zip |
simplify condition
-rw-r--r-- | mitmproxy/addons/export.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/mitmproxy/addons/export.py b/mitmproxy/addons/export.py index cc698f9c..2776118a 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 |