diff options
author | 2024-02-21 15:15:39 +0100 | |
---|---|---|
committer | 2024-02-22 16:59:47 +0100 | |
commit | 139f9b088e4bc02b4bc4ff6b37a1261ac0f4cadf (patch) | |
tree | f133ea9289d1c6470b6ed7375bc02a1a14d536eb /src/main | |
parent | 41dafac1b153d3db7f99c94dfee1b87ec10330f5 (diff) |
Update aai-common version to 1.13.4 in graphadmin
- update to 1.13.4
- bump activemq dep to fix security vulnerability
- update mockito from 1.X to 3.4
- bump graphadmin version to 1.13.4 to be in sync with aai-common
Issue-ID: AAI-3784
Change-Id: Idcaf9b18ce6cb100b5db88ce0fc6d62157b6c387
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/onap/aai/interceptors/pre/RequestTransactionLogging.java | 7 | ||||
-rw-r--r-- | src/main/java/org/onap/aai/rest/util/EchoResponse.java | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/org/onap/aai/interceptors/pre/RequestTransactionLogging.java b/src/main/java/org/onap/aai/interceptors/pre/RequestTransactionLogging.java index 6aa180b..ecaff91 100644 --- a/src/main/java/org/onap/aai/interceptors/pre/RequestTransactionLogging.java +++ b/src/main/java/org/onap/aai/interceptors/pre/RequestTransactionLogging.java @@ -34,6 +34,7 @@ import org.springframework.beans.factory.annotation.Autowired; import javax.annotation.Priority; import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.HttpMethod; import javax.ws.rs.container.ContainerRequestContext; import javax.ws.rs.container.ContainerRequestFilter; import javax.ws.rs.container.PreMatching; @@ -86,11 +87,13 @@ public class RequestTransactionLogging extends AAIContainerFilter implements Con String contentType = headersMap.getFirst(CONTENT_TYPE); String acceptType = headersMap.getFirst(ACCEPT); - if(contentType == null || contentType.contains(TEXT_PLAIN)){ + if(contentType == null && !requestContext.getMethod().equals(HttpMethod.GET.toString())){ + LOGGER.debug("Content Type header missing in the request, adding one of [{}]", DEFAULT_CONTENT_TYPE); requestContext.getHeaders().putSingle(CONTENT_TYPE, DEFAULT_CONTENT_TYPE); } - if(acceptType == null || acceptType.contains(TEXT_PLAIN)){ + if(acceptType == null){ + LOGGER.debug("Accept header missing in the request, adding one of [{}]", DEFAULT_RESPONSE_TYPE); requestContext.getHeaders().putSingle(ACCEPT, DEFAULT_RESPONSE_TYPE); } } diff --git a/src/main/java/org/onap/aai/rest/util/EchoResponse.java b/src/main/java/org/onap/aai/rest/util/EchoResponse.java index 05ff38e..91841df 100644 --- a/src/main/java/org/onap/aai/rest/util/EchoResponse.java +++ b/src/main/java/org/onap/aai/rest/util/EchoResponse.java @@ -94,7 +94,7 @@ public class EchoResponse extends RESTAPI { response = Response.status(Status.OK) .entity(ErrorLogHelper.getRESTAPIInfoResponse( - headers.getAcceptableMediaTypes(), exceptionList)) + new ArrayList<>(headers.getAcceptableMediaTypes()), exceptionList)) .build(); } catch (Exception e) { @@ -106,7 +106,7 @@ public class EchoResponse extends RESTAPI { response = Response .status(Status.INTERNAL_SERVER_ERROR) .entity(ErrorLogHelper.getRESTAPIErrorResponse( - headers.getAcceptableMediaTypes(), ex, + new ArrayList<>(headers.getAcceptableMediaTypes()), ex, templateVars)).build(); } finally { |