diff options
author | Pavel Paroulek <pavel.paroulek@orange.com> | 2018-10-25 20:36:56 +0200 |
---|---|---|
committer | Pavel Paroulek <pavel.paroulek@orange.com> | 2018-10-25 20:36:56 +0200 |
commit | 34c246d10f1d064cf605f2dc6bd49e48cda879d4 (patch) | |
tree | f510f4cca06a46cb2b5480ebb742214a2b8bb115 /aai-resources/src/main/java/org | |
parent | 35d58583ad3caaa5b87d1edfc895bc7b97e555e3 (diff) |
Check if response not sent1.3.1
Check if someone else didn't already flush the response
Change-Id: I9460697e6d8e05817d6af0fea8a0d7dad56ec605
Issue-ID: AAI-32
Signed-off-by: Pavel Paroulek <pavel.paroulek@orange.com>
Diffstat (limited to 'aai-resources/src/main/java/org')
-rw-r--r-- | aai-resources/src/main/java/org/onap/aai/config/aaf/ResponseFormatter.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/aai-resources/src/main/java/org/onap/aai/config/aaf/ResponseFormatter.java b/aai-resources/src/main/java/org/onap/aai/config/aaf/ResponseFormatter.java index ca09730..b4df002 100644 --- a/aai-resources/src/main/java/org/onap/aai/config/aaf/ResponseFormatter.java +++ b/aai-resources/src/main/java/org/onap/aai/config/aaf/ResponseFormatter.java @@ -34,6 +34,10 @@ class ResponseFormatter { private static final String ACCEPT_HEADER = "accept"; static void errorResponse(HttpServletRequest request, HttpServletResponse response) throws IOException { + if (response.isCommitted()){ + return; + } + String accept = request.getHeader(ACCEPT_HEADER) == null ? MediaType.APPLICATION_XML : request.getHeader(ACCEPT_HEADER); AAIException aaie = new AAIException("AAI_3300"); response.setStatus(aaie.getErrorObject().getHTTPResponseCode().getStatusCode()); |