Revert "Avoid empty body failure on HEAD requests"
This reverts commit 5e8dfb9065e260f39334016b777423c413463ffe. Change-Id: Ia82e11b65c0d175f2d3b517e43176213eb1a4ae0
This commit is contained in:
parent
437d5de4e9
commit
f68b2fb9d6
@ -531,14 +531,13 @@ class Jenkins(object):
|
|||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
|
||||||
headers = response.headers
|
headers = response.headers
|
||||||
if response.request.method != 'HEAD':
|
if (headers.get('content-length') is None and
|
||||||
if (headers.get('content-length') is None and
|
headers.get('transfer-encoding') is None and
|
||||||
headers.get('transfer-encoding') is None and
|
(response.content is None or len(response.content) <= 0)):
|
||||||
(response.content is None or len(response.content) <= 0)):
|
# response body should only exist if one of these is provided
|
||||||
# response body should only exist if one of these is provided
|
raise EmptyResponseException(
|
||||||
raise EmptyResponseException(
|
"Error communicating with server[%s]: "
|
||||||
"Error communicating with server[%s]: "
|
"empty response" % self.server)
|
||||||
"empty response" % self.server)
|
|
||||||
|
|
||||||
# Response objects will automatically return unicode encoded
|
# Response objects will automatically return unicode encoded
|
||||||
# when accessing .text property
|
# when accessing .text property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user