Skip to content

Commit d44a599

Browse files
MpdreamzSukharevAndrey
authored andcommitted
fix elastic#3585 VoidResponse should not be shared (elastic#3588)
(cherry picked from commit 088e5b0)
1 parent 37be7cd commit d44a599

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Elasticsearch.Net/Transport/Pipeline/ResponseBuilder.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ public static class ResponseBuilder
1414
private static readonly Type[] SpecialTypes =
1515
{ typeof(StringResponse), typeof(BytesResponse), typeof(VoidResponse), typeof(DynamicResponse) };
1616

17-
private static readonly VoidResponse StaticVoid = new VoidResponse { Body = new VoidResponse.VoidBody() };
18-
1917
public static TResponse ToResponse<TResponse>(
2018
RequestData requestData,
2119
Exception ex,
@@ -150,7 +148,7 @@ private static bool SetSpecialTypes<TResponse>(byte[] bytes, out TResponse cs)
150148
else if (responseType == typeof(BytesResponse))
151149
cs = new BytesResponse(bytes) as TResponse;
152150
else if (responseType == typeof(VoidResponse))
153-
cs = StaticVoid as TResponse;
151+
cs = new VoidResponse() as TResponse;
154152
else if (responseType == typeof(DynamicResponse))
155153
{
156154
using (var ms = new MemoryStream(bytes))

0 commit comments

Comments
 (0)