Avoid empty body failure on HEAD requests
HTTP specification states clearly that HEAD requests should have no body, so we should not fail on these. Change-Id: I9d2418f26c26b2a40f6bafaf86ed6640fbf83b0c
This commit is contained in:
parent
4150a83d45
commit
5e8dfb9065
|
@ -531,6 +531,7 @@ 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)):
|
||||
|
|
Loading…
Reference in New Issue