Merge pull request #3900 from mhils/sans-io-adjustments

Minor sans-io adjustments
This commit is contained in:
Maximilian Hils 2020-04-05 02:07:01 +02:00 committed by GitHub
commit 775e6beec5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

1
.gitignore vendored
View File

@ -17,6 +17,7 @@ dist/
mitmproxy/contrib/kaitaistruct/*.ksy
.pytest_cache
__pycache__
.hypothesis/
# UI

View File

@ -220,8 +220,8 @@ def expected_http_body_size(
if size < 0:
raise ValueError()
return size
except ValueError:
raise exceptions.HttpSyntaxException("Unparseable Content Length")
except ValueError as e:
raise exceptions.HttpSyntaxException("Unparseable Content Length") from e
if not response:
return 0
return -1