Revision: 6247 http://sourceforge.net/p/jump-pilot/code/6247 Author: michaudm Date: 2020-04-12 23:06:52 +0000 (Sun, 12 Apr 2020) Log Message: ----------- Fix #492 GetFeatureInfo without certificate + encoding
Modified Paths: -------------- core/trunk/src/com/vividsolutions/wms/AbstractWMSRequest.java Modified: core/trunk/src/com/vividsolutions/wms/AbstractWMSRequest.java =================================================================== --- core/trunk/src/com/vividsolutions/wms/AbstractWMSRequest.java 2020-04-12 22:59:57 UTC (rev 6246) +++ core/trunk/src/com/vividsolutions/wms/AbstractWMSRequest.java 2020-04-12 23:06:52 UTC (rev 6247) @@ -160,13 +160,15 @@ protected String readConnection(HttpURLConnection con, long limit) throws IOException { boolean httpOk = con.getResponseCode() == HttpURLConnection.HTTP_OK; // get correct stream - InputStream in = httpOk ? con..getInputStream() : con.getErrorStream(); + InputStream in = httpOk ? con.getInputStream() : con.getErrorStream(); String result = ""; if (in!=null) { // limit max chars BoundedInputStream bin = new BoundedInputStream(in, limit > 0 ? limit : -1); - result = new String(bin.readAllBytes(), Charsets.UTF_8); + byte[] bytes = new byte[bin.available()]; + bin.read(bytes); + result = new String(bytes, Charsets.UTF_8); //result = IOUtils.toString(bin); FileUtil.close(bin); } _______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel