diff --git a/src/main/java/org/opensearch/security/auditlog/impl/AuditMessage.java b/src/main/java/org/opensearch/security/auditlog/impl/AuditMessage.java index c26e7802a3..b57becc359 100644 --- a/src/main/java/org/opensearch/security/auditlog/impl/AuditMessage.java +++ b/src/main/java/org/opensearch/security/auditlog/impl/AuditMessage.java @@ -363,7 +363,7 @@ public void addRestHeaders(Map> headers, boolean excludeSen headersClone.keySet().removeIf(AUTHORIZATION_HEADER); } if (filter != null) { - headersClone.entrySet().removeIf(entry -> filter.isHeaderDisabled(entry.getKey())); + headersClone.entrySet().removeIf(entry -> filter.shouldExcludeHeader(entry.getKey())); } auditInfo.put(REST_REQUEST_HEADERS, headersClone); }