diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2016-09-30 09:22:29 +0200 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2016-10-07 07:44:58 +0200 |
commit | 961f785060f749ed97b0516745cb9ad2fd2704cc (patch) | |
tree | 23c10876368166f1e65a6719d31ae81784d54b8f /id/server/modules/moa-id-module-eIDAS/src | |
parent | 58c843aa630c1e6fd2680cf019f7e270abbe9a69 (diff) | |
download | moa-id-spss-961f785060f749ed97b0516745cb9ad2fd2704cc.tar.gz moa-id-spss-961f785060f749ed97b0516745cb9ad2fd2704cc.tar.bz2 moa-id-spss-961f785060f749ed97b0516745cb9ad2fd2704cc.zip |
refactor http servlet response processing to prohibit 'chunked' transfer encoding
Diffstat (limited to 'id/server/modules/moa-id-module-eIDAS/src')
3 files changed, 12 insertions, 4 deletions
diff --git a/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/auth/modules/eidas/tasks/GenerateAuthnRequestTask.java b/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/auth/modules/eidas/tasks/GenerateAuthnRequestTask.java index 30c206025..84b0078b3 100644 --- a/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/auth/modules/eidas/tasks/GenerateAuthnRequestTask.java +++ b/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/auth/modules/eidas/tasks/GenerateAuthnRequestTask.java @@ -179,8 +179,11 @@ public class GenerateAuthnRequestTask extends AbstractAuthServletTask { Logger.debug("Sending html content: " + writer.getBuffer().toString()); + + byte[] content = writer.getBuffer().toString().getBytes("UTF-8"); response.setContentType(MediaType.HTML_UTF_8.toString()); - response.getOutputStream().write(writer.getBuffer().toString().getBytes("UTF-8")); + response.setContentLength(content.length); + response.getOutputStream().write(content); revisionsLogger.logEvent(oaConfig, pendingReq, MOAIDEventConstants.AUTHPROCESS_PEPS_REQUESTED, diff --git a/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/EIDASProtocol.java b/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/EIDASProtocol.java index 24134f1d9..779d898be 100644 --- a/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/EIDASProtocol.java +++ b/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/EIDASProtocol.java @@ -316,9 +316,11 @@ public class EIDASProtocol extends AbstractAuthProtocolModulController { Logger.trace("Sending html content : " + new String(writer.getBuffer())); - response.getOutputStream().write(writer.getBuffer().toString().getBytes("UTF-8")); + byte[] content = writer.getBuffer().toString().getBytes("UTF-8"); response.setContentType(MediaType.TEXT_HTML.getType()); - + response.setContentLength(content.length); + response.getOutputStream().write(content); + return true; } catch (Exception e1 ) { diff --git a/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/eIDASAuthenticationRequest.java b/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/eIDASAuthenticationRequest.java index 9943cc5fb..ebd4e1e6d 100644 --- a/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/eIDASAuthenticationRequest.java +++ b/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/eIDASAuthenticationRequest.java @@ -165,8 +165,11 @@ public class eIDASAuthenticationRequest implements IAction { Logger.trace("Sending html content : " + new String(writer.getBuffer())); - httpResp.getOutputStream().write(writer.getBuffer().toString().getBytes("UTF-8")); + byte[] content = writer.getBuffer().toString().getBytes("UTF-8"); httpResp.setContentType(MediaType.TEXT_HTML.getType()); + httpResp.setContentLength(content.length); + httpResp.getOutputStream().write(content); + } catch (Exception e) { Logger.error("Velocity error: " + e.getMessage()); |