diff options
author | Georg Brandl <georg@python.org> | 2008-02-24 00:14:24 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-02-24 00:14:24 (GMT) |
commit | 8c460d52417e764fc21362087b9314dbc09039bd (patch) | |
tree | d2b4cf3f5bfed14bcbc5a04b52b8b0ad79364449 /Lib/httplib.py | |
parent | 2363503074a3f1c2dbe934bed0c865d326e34c1a (diff) | |
download | cpython-8c460d52417e764fc21362087b9314dbc09039bd.zip cpython-8c460d52417e764fc21362087b9314dbc09039bd.tar.gz cpython-8c460d52417e764fc21362087b9314dbc09039bd.tar.bz2 |
#1627: httplib now ignores negative Content-Length headers.
Diffstat (limited to 'Lib/httplib.py')
-rw-r--r-- | Lib/httplib.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py index bb4b59e..5696467 100644 --- a/Lib/httplib.py +++ b/Lib/httplib.py @@ -438,6 +438,9 @@ class HTTPResponse: self.length = int(length) except ValueError: self.length = None + else: + if self.length < 0: # ignore nonsensical negative lengths + self.length = None else: self.length = None |