aboutsummaryrefslogtreecommitdiff
path: root/id
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2017-02-03 08:47:16 +0100
committerThomas Lenz <tlenz@iaik.tugraz.at>2017-02-03 08:47:16 +0100
commite25d9bfa5fb81fd275706fb7cbee21fe5add5b19 (patch)
tree28e34446dc263144a09441120b0483e50e8e95b2 /id
parent01f3c42ba43f674b7a5b8ebd90762326d56eaf4e (diff)
downloadmoa-id-spss-e25d9bfa5fb81fd275706fb7cbee21fe5add5b19.tar.gz
moa-id-spss-e25d9bfa5fb81fd275706fb7cbee21fe5add5b19.tar.bz2
moa-id-spss-e25d9bfa5fb81fd275706fb7cbee21fe5add5b19.zip
prohibit chunked transfer encoding in eIDAS metadata response
Diffstat (limited to 'id')
-rw-r--r--id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/EidasMetaDataRequest.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/EidasMetaDataRequest.java b/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/EidasMetaDataRequest.java
index aada999db..df96bef12 100644
--- a/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/EidasMetaDataRequest.java
+++ b/id/server/modules/moa-id-module-eIDAS/src/main/java/at/gv/egovernment/moa/id/protocols/eidas/EidasMetaDataRequest.java
@@ -72,14 +72,19 @@ public class EidasMetaDataRequest implements IAction {
String metadata_url = pubURLPrefix + Constants.eIDAS_HTTP_ENDPOINT_METADATA;
String sp_return_url = pubURLPrefix + Constants.eIDAS_HTTP_ENDPOINT_SP_POST;
+ //generate eIDAS metadata
String metaData = generateMetadata(req, metadata_url, sp_return_url);
-
+
+ //write content to response
+ byte[] content = metaData.getBytes("UTF-8");
+ httpResp.setStatus(HttpServletResponse.SC_OK);
+ httpResp.setContentType(MediaType.APPLICATION_XML.toString());
+ httpResp.setContentLength(content.length);
+ httpResp.getOutputStream().write(content);
+
+ //write log if required
Logger.trace(metaData);
-
- httpResp.setContentType(MediaType.APPLICATION_XML.toString());
- httpResp.getWriter().print(metaData);
- httpResp.flushBuffer();
-
+
} catch (Exception e) {
Logger.error("eIDAS Metadata generation FAILED.", e);
throw new MOAIDException("eIDAS.05", new Object[]{e.getMessage()}, e);