Skip to content

Commit 6351b57

Browse files
committed
Smarter format recognition when parsing nodes.hot_threads response
1 parent 08bef0d commit 6351b57

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Nest/ElasticClient-Nodes.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,11 @@ private NodesHotThreadsResponse DeserializeNodesHotThreadResponse(IElasticsearch
143143
var typedResponse = new NodesHotThreadsResponse();
144144
var plainTextResponse = Encoding.UTF8.GetString(response.ResponseRaw);
145145

146-
// If the response doesn't contain :::, which is the pattern that delimits
146+
// If the response doesn't start with :::, which is the pattern that delimits
147147
// each node section in the response, then the response format isn't recognized.
148148
// Just return an empty response object. This is especially useful when unit
149149
// testing against an in-memory connection where you won't get a real response.
150-
if (!plainTextResponse.Contains(":::"))
150+
if (!plainTextResponse.StartsWith(":::"))
151151
return typedResponse;
152152

153153
var sections = plainTextResponse.Split(new string[] { ":::" }, StringSplitOptions.RemoveEmptyEntries);

0 commit comments

Comments
 (0)