From: <jos...@us...> - 2010-09-16 21:45:25
|
Revision: 6570 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=6570&view=rev Author: josegar74 Date: 2010-09-16 21:45:19 +0000 (Thu, 16 Sep 2010) Log Message: ----------- Fix to solve about some responses are cut when returned to the client Modified Paths: -------------- trunk/web/src/main/java/org/geonetwork/http/proxy/HttpProxyServlet.java Modified: trunk/web/src/main/java/org/geonetwork/http/proxy/HttpProxyServlet.java =================================================================== --- trunk/web/src/main/java/org/geonetwork/http/proxy/HttpProxyServlet.java 2010-09-16 21:40:43 UTC (rev 6569) +++ trunk/web/src/main/java/org/geonetwork/http/proxy/HttpProxyServlet.java 2010-09-16 21:45:19 UTC (rev 6570) @@ -117,11 +117,13 @@ response.setContentType(getResponseContentType(contentTypesReturned)); String responseBody = httpGet.getResponseBodyAsString().trim(); - response.setContentLength(responseBody.length()); PrintWriter out = response.getWriter(); out.print(responseBody); - response.flushBuffer(); + + out.flush(); + out.close(); + } else { returnExceptionMessage(response, "Unexpected failure: " + httpGet.getStatusLine().toString()); } @@ -196,8 +198,11 @@ response.setContentType(getResponseContentType(contentTypesReturned)); String responseBody = httpPost.getResponseBodyAsString(); - response.setContentLength(responseBody.length()); + out.print(responseBody); + out.flush(); + out.close(); + } else { returnExceptionMessage(response, "Unexpected failure: " + httpPost.getStatusLine().toString()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |