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