if (solrRecord.getWorkspaceName().length() > 0){
layerName += solrRecord.getWorkspaceName() + ":" + solrRecord.getName();
} else {
layerName += solrRecord.getName();
}
BasicHttpEntityEnclosingRequest proxyRequest =
new BasicHttpEntityEnclosingRequest(servletRequest.getMethod(), rewriteUrlFromRequest(layerName, servletRequest));
copyRequestHeaders(servletRequest, proxyRequest);
// Add the input entity (streamed) then execute the request.
HttpResponse proxyResponse = null;
InputStream servletRequestInputStream = servletRequest.getInputStream();
try {
try {
proxyRequest.setEntity(new InputStreamEntity(servletRequestInputStream, servletRequest.getContentLength()));
// Execute the request
logger.debug("proxy " + servletRequest.getMethod() + " uri: " + servletRequest.getRequestURI() + " -- " + proxyRequest.getRequestLine().getUri());
proxyResponse = proxyClient.execute(URIUtils.extractHost(targetUri), proxyRequest);
} finally {
closeQuietly(servletRequestInputStream);
}