From 961f785060f749ed97b0516745cb9ad2fd2704cc Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Fri, 30 Sep 2016 09:22:29 +0200 Subject: refactor http servlet response processing to prohibit 'chunked' transfer encoding --- .../moa/id/configuration/auth/pvp2/servlets/BuildMetadata.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'id/ConfigWebTool/src/main') diff --git a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/auth/pvp2/servlets/BuildMetadata.java b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/auth/pvp2/servlets/BuildMetadata.java index 5b413567a..7256d8688 100644 --- a/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/auth/pvp2/servlets/BuildMetadata.java +++ b/id/ConfigWebTool/src/main/java/at/gv/egovernment/moa/id/configuration/auth/pvp2/servlets/BuildMetadata.java @@ -285,12 +285,12 @@ public class BuildMetadata extends HttpServlet { transformer.transform(source, sr); sw.close(); - String metadataXML = sw.toString(); + byte[] metadataXML = sw.toString().getBytes("UTF-8"); response.setContentType("text/xml"); - response.getOutputStream().write(metadataXML.getBytes()); + response.setContentLength(metadataXML.length); + response.getOutputStream().write(metadataXML); - response.getOutputStream().close(); } catch (ConfigurationException e) { log.warn("Configuration can not be loaded.", e); -- cgit v1.2.3