Skip to content

fix #3585 VoidResponse should not be shared #3588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/Elasticsearch.Net/Transport/Pipeline/ResponseBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ public static class ResponseBuilder
private static readonly Type[] SpecialTypes =
{ typeof(StringResponse), typeof(BytesResponse), typeof(VoidResponse), typeof(DynamicResponse) };

private static readonly VoidResponse StaticVoid = new VoidResponse { Body = new VoidResponse.VoidBody() };

public static TResponse ToResponse<TResponse>(
RequestData requestData,
Exception ex,
Expand Down Expand Up @@ -150,7 +148,7 @@ private static bool SetSpecialTypes<TResponse>(byte[] bytes, out TResponse cs)
else if (responseType == typeof(BytesResponse))
cs = new BytesResponse(bytes) as TResponse;
else if (responseType == typeof(VoidResponse))
cs = StaticVoid as TResponse;
cs = new VoidResponse() as TResponse;
else if (responseType == typeof(DynamicResponse))
{
using (var ms = new MemoryStream(bytes))
Expand Down