HTTPCLIENT-1009: [follow-up] chunked value for CombinedEntity

Contributed by Joe Campbell <joseph.r.campbell at gmail.com>


git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1022947 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2010-10-15 14:35:28 +00:00
parent 0f2cc20b22
commit dfe45e8f56
1 changed files with 2 additions and 0 deletions

View File

@ -117,11 +117,13 @@ class SizeLimitedResponseReader {
ensureConsumed();
HttpResponse reconstructed = new BasicHttpResponse(response.getStatusLine());
reconstructed.setHeaders(response.getAllHeaders());
CombinedEntity combinedEntity = new CombinedEntity(resource, instream);
HttpEntity entity = response.getEntity();
if (entity != null) {
combinedEntity.setContentType(entity.getContentType());
combinedEntity.setContentEncoding(entity.getContentEncoding());
combinedEntity.setChunked(entity.isChunked());
}
reconstructed.setEntity(combinedEntity);
return reconstructed;