From d025c38a426e22b0d1ccfbb4558ff6ce78ac1d0b 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/protocols/saml1/GetAuthenticationDataService.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment') diff --git a/id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetAuthenticationDataService.java b/id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetAuthenticationDataService.java index 893799b5d..13df30862 100644 --- a/id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetAuthenticationDataService.java +++ b/id/server/modules/moa-id-modules-saml1/src/main/java/at/gv/egovernment/moa/id/protocols/saml1/GetAuthenticationDataService.java @@ -344,8 +344,11 @@ public class GetAuthenticationDataService extends AbstractController implements VelocityEngine engine = VelocityProvider.getClassPathVelocityEngine(); BufferedReader reader = new BufferedReader(new InputStreamReader(is )); StringWriter writer = new StringWriter(); - engine.evaluate(context, writer, "SAML1 GetAuthenticationData", reader); - httpResp.getOutputStream().write(writer.toString().getBytes("UTF-8")); + engine.evaluate(context, writer, "SAML1 GetAuthenticationData", reader); + + byte[] content = writer.toString().getBytes("UTF-8"); + httpResp.setContentLength(content.length); + httpResp.getOutputStream().write(content); } catch (Exception e) { Logger.error("SAML1 GetAuthenticationData has an error:", e); -- cgit v1.2.3