We don't need the content length as an int; avoid the boxing
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1571393 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
92448db3b4
commit
036e717655
|
@ -213,7 +213,7 @@ class BasicHttpCache implements HttpCache {
|
||||||
|
|
||||||
CloseableHttpResponse generateIncompleteResponseError(
|
CloseableHttpResponse generateIncompleteResponseError(
|
||||||
final HttpResponse response, final Resource resource) {
|
final HttpResponse response, final Resource resource) {
|
||||||
final int contentLength = Integer.parseInt(response.getFirstHeader(HTTP.CONTENT_LEN).getValue());
|
final Integer contentLength = Integer.valueOf(response.getFirstHeader(HTTP.CONTENT_LEN).getValue());
|
||||||
final HttpResponse error =
|
final HttpResponse error =
|
||||||
new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_BAD_GATEWAY, "Bad Gateway");
|
new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_BAD_GATEWAY, "Bad Gateway");
|
||||||
error.setHeader("Content-Type","text/plain;charset=UTF-8");
|
error.setHeader("Content-Type","text/plain;charset=UTF-8");
|
||||||
|
|
Loading…
Reference in New Issue