diff options
author | Maximilian Hils <git@maximilianhils.com> | 2013-12-15 06:42:58 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2013-12-15 06:42:58 +0100 |
commit | 7049becdfe5fa16820fc7dd3da0866cf08464efd (patch) | |
tree | bf00ecd827cbf48d51d6dac4b84c7c82e34e8282 /libpathod/language.py | |
parent | 42aede6181c643bb5bbd35ca81b6c1b1c69ec4b5 (diff) | |
download | mitmproxy-7049becdfe5fa16820fc7dd3da0866cf08464efd.tar.gz mitmproxy-7049becdfe5fa16820fc7dd3da0866cf08464efd.tar.bz2 mitmproxy-7049becdfe5fa16820fc7dd3da0866cf08464efd.zip |
always return Content-Length: 0 if r is not set
Diffstat (limited to 'libpathod/language.py')
-rw-r--r-- | libpathod/language.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libpathod/language.py b/libpathod/language.py index 5cce6fde..ed5e5f60 100644 --- a/libpathod/language.py +++ b/libpathod/language.py @@ -765,11 +765,12 @@ class _Message(object): def resolve(self, settings, request_host): tokens = self.tokens[:] if not self.raw: - if self.body and not utils.get_header("Content-Length", self.headers): + if not utils.get_header("Content-Length", self.headers): + length = 0 if not self.body else len(self.body.value.get_generator(settings)) tokens.append( Header( ValueLiteral("Content-Length"), - ValueLiteral(str(len(self.body.value.get_generator(settings)))), + ValueLiteral(str(length)), ) ) if request_host: |