HTTPCLIENT-975: more method extraction from the body of
CachingHttpClient#execute() git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1051087 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
cd263f39e3
commit
65cb252c9b
|
@ -383,12 +383,9 @@ public class CachingHttpClient implements HttpClient {
|
||||||
return new OptionsHttp11Response();
|
return new OptionsHttp11Response();
|
||||||
}
|
}
|
||||||
|
|
||||||
List<RequestProtocolError> fatalError = requestCompliance.requestIsFatallyNonCompliant(request);
|
HttpResponse fatalErrorResponse = getFatallyNoncompliantResponse(
|
||||||
|
request, context);
|
||||||
for (RequestProtocolError error : fatalError) {
|
if (fatalErrorResponse != null) return fatalErrorResponse;
|
||||||
setResponseStatus(context, CacheResponseStatus.CACHE_MODULE_RESPONSE);
|
|
||||||
return requestCompliance.getErrorForRequest(error);
|
|
||||||
}
|
|
||||||
|
|
||||||
request = requestCompliance.makeRequestCompliant(request);
|
request = requestCompliance.makeRequestCompliant(request);
|
||||||
request.addHeader("Via",via);
|
request.addHeader("Via",via);
|
||||||
|
@ -453,6 +450,19 @@ public class CachingHttpClient implements HttpClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return callBackend(target, request, context);
|
return callBackend(target, request, context);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private HttpResponse getFatallyNoncompliantResponse(HttpRequest request,
|
||||||
|
HttpContext context) {
|
||||||
|
HttpResponse fatalErrorResponse = null;
|
||||||
|
List<RequestProtocolError> fatalError = requestCompliance.requestIsFatallyNonCompliant(request);
|
||||||
|
|
||||||
|
for (RequestProtocolError error : fatalError) {
|
||||||
|
setResponseStatus(context, CacheResponseStatus.CACHE_MODULE_RESPONSE);
|
||||||
|
fatalErrorResponse = requestCompliance.getErrorForRequest(error);
|
||||||
|
}
|
||||||
|
return fatalErrorResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<String, Variant> getExistingCacheVariants(HttpHost target,
|
private Map<String, Variant> getExistingCacheVariants(HttpHost target,
|
||||||
|
|
Loading…
Reference in New Issue