Skip to content

Commit 76c3550

Browse files
author
Dishita Suyal
committed
FINERACT-2591: Log debug when Idempotency-Key header is missing
1 parent 23c67f7 commit 76c3550

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

fineract-core/src/main/java/org/apache/fineract/infrastructure/core/filters/IdempotencyStoreFilter.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ public class IdempotencyStoreFilter extends OncePerRequestFilter {
4848
protected void doFilterInternal(@NonNull HttpServletRequest request, @NonNull HttpServletResponse response,
4949
@NonNull FilterChain filterChain) throws ServletException, IOException {
5050
Mutable<ContentCachingResponseWrapper> wrapper = new MutableObject<>();
51+
String headerName = fineractProperties.getIdempotencyKeyHeaderName();
52+
String idempotencyKey = request.getHeader(headerName);
53+
54+
if (headerName != null && !headerName.isBlank() &&
55+
(idempotencyKey == null || idempotencyKey.isBlank())) {
56+
57+
log.debug("Missing {} for request: {} {}",
58+
headerName,
59+
request.getMethod(),
60+
request.getRequestURI());
61+
}
5162
if (helper.isAllowedContentTypeRequest(request)) {
5263
wrapper.setValue(new ContentCachingResponseWrapper(response));
5364
}

0 commit comments

Comments
 (0)