mirror of https://github.com/python/cpython
cope with weird Content-Length values returned from servers by
ignoring them; e.g. Zope sometimes returns 13497L
This commit is contained in:
parent
7a666b83c8
commit
30a818196e
|
@ -166,7 +166,10 @@ class HTTPResponse:
|
||||||
# NOTE: RFC 2616, S4.4, #3 says we ignore this if tr_enc is "chunked"
|
# NOTE: RFC 2616, S4.4, #3 says we ignore this if tr_enc is "chunked"
|
||||||
length = self.msg.getheader('content-length')
|
length = self.msg.getheader('content-length')
|
||||||
if length and not self.chunked:
|
if length and not self.chunked:
|
||||||
self.length = int(length)
|
try:
|
||||||
|
self.length = int(length)
|
||||||
|
except ValueError:
|
||||||
|
self.length = None
|
||||||
else:
|
else:
|
||||||
self.length = None
|
self.length = None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue