HEAD requests return no body
This commit is contained in:
@@ -107,8 +107,11 @@ class InidicesClient(NamespacedClient):
|
|||||||
|
|
||||||
:arg index: A comma-separated list of indices to check
|
:arg index: A comma-separated list of indices to check
|
||||||
"""
|
"""
|
||||||
status, data = self.transport.perform_request('HEAD', '/' + _normalize_list(index), params=params)
|
try:
|
||||||
return data
|
self.transport.perform_request('HEAD', '/' + _normalize_list(index), params=params)
|
||||||
|
except NotFoundError:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
class Elasticsearch(object):
|
class Elasticsearch(object):
|
||||||
|
|||||||
@@ -226,5 +226,8 @@ class Transport(object):
|
|||||||
# resurrected connection didn't fail, confirm it's live status
|
# resurrected connection didn't fail, confirm it's live status
|
||||||
if dead_count:
|
if dead_count:
|
||||||
self.connection_pool.mark_live(connection)
|
self.connection_pool.mark_live(connection)
|
||||||
return status, self.serializer.loads(raw_data)
|
data = None
|
||||||
|
if raw_data:
|
||||||
|
data = self.serializer.loads(raw_data)
|
||||||
|
return status, data
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user