Skip to content
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

Add non-null ResponseBody for responses with empty body #1585

Merged
merged 2 commits into from
Oct 16, 2018

Conversation

OKoneva
Copy link
Contributor

@OKoneva OKoneva commented Oct 12, 2018

@@ -254,6 +254,8 @@ private Response toOkhttpResponse(org.asynchttpclient.Response asyncHttpClientRe
? null : MediaType.parse(asyncHttpClientResponse.getContentType());
val okHttpBody = ResponseBody.create(contentType, asyncHttpClientResponse.getResponseBodyAsBytes());
rspBuilder.body(okHttpBody);
} else {
rspBuilder.body(ResponseBody.create(null, ""));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make ResponseBody.create(null, "") a constant

@slandelle slandelle merged commit e3bbad7 into AsyncHttpClient:master Oct 16, 2018
@slandelle
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants