File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
cloudinary-http43/src/main/java/com/cloudinary/http43
cloudinary-http44/src/main/java/com/cloudinary/http44 Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1010import com .cloudinary .utils .ObjectUtils ;
1111import com .cloudinary .utils .StringUtils ;
1212import org .apache .http .Consts ;
13+ import org .apache .http .HttpEntity ;
1314import org .apache .http .HttpHost ;
1415import org .apache .http .client .config .RequestConfig ;
1516import org .apache .http .client .entity .UrlEncodedFormEntity ;
2122import org .apache .http .impl .client .CloseableHttpClient ;
2223import org .apache .http .impl .client .HttpClientBuilder ;
2324import org .apache .http .impl .client .HttpClients ;
25+ import org .apache .http .util .EntityUtils ;
2426import org .cloudinary .json .JSONException ;
2527import org .cloudinary .json .JSONObject ;
2628
@@ -98,8 +100,9 @@ private ApiResponse getApiResponse(HttpUriRequest request) throws Exception {
98100 CloseableHttpResponse response = client .execute (request );
99101 try {
100102 code = response .getStatusLine ().getStatusCode ();
101- InputStream responseStream = response .getEntity ().getContent ();
102- responseData = StringUtils .read (responseStream );
103+ final HttpEntity entity = response .getEntity ();
104+ responseData = StringUtils .read (entity .getContent ());
105+ EntityUtils .consume (entity );
103106 } finally {
104107 response .close ();
105108 }
Original file line number Diff line number Diff line change 1010import com .cloudinary .utils .ObjectUtils ;
1111import com .cloudinary .utils .StringUtils ;
1212import org .apache .http .Consts ;
13+ import org .apache .http .HttpEntity ;
1314import org .apache .http .HttpHost ;
1415import org .apache .http .NameValuePair ;
1516import org .apache .http .client .config .RequestConfig ;
2223import org .apache .http .impl .client .CloseableHttpClient ;
2324import org .apache .http .impl .client .HttpClientBuilder ;
2425import org .apache .http .impl .client .HttpClients ;
26+ import org .apache .http .util .EntityUtils ;
2527import org .cloudinary .json .JSONException ;
2628import org .cloudinary .json .JSONObject ;
2729
@@ -100,8 +102,9 @@ private ApiResponse getApiResponse(HttpUriRequest request) throws Exception {
100102 CloseableHttpResponse response = client .execute (request );
101103 try {
102104 code = response .getStatusLine ().getStatusCode ();
103- InputStream responseStream = response .getEntity ().getContent ();
104- responseData = StringUtils .read (responseStream );
105+ final HttpEntity entity = response .getEntity ();
106+ responseData = StringUtils .read (entity .getContent ());
107+ EntityUtils .consume (entity );
105108 } finally {
106109 response .close ();
107110 }
You can’t perform that action at this time.
0 commit comments