simplify condition

This commit is contained in:
Maximilian Hils 2019-10-29 16:15:07 +01:00 committed by GitHub
parent 6da1db750c
commit fcccab684d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 3 deletions

View File

@ -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