Skip to content

Commit 79bc81f

Browse files
authored
chore: log only if condition doesn't match
Signed-off-by: Joaquin Santana <joaquinjsb@outlook.com>
1 parent 07a50b4 commit 79bc81f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

web/src/main/java/org/springframework/security/web/header/writers/ClearSiteDataHeaderWriter.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,12 @@ public void writeHeaders(HttpServletRequest request, HttpServletResponse respons
7474
if (this.requestMatcher.matches(request)) {
7575
if (!response.containsHeader(CLEAR_SITE_DATA_HEADER)) {
7676
response.setHeader(CLEAR_SITE_DATA_HEADER, this.headerValue);
77-
}
77+
}
78+
} else {
79+
this.logger.debug(
80+
LogMessage.format("Not injecting Clear-Site-Data header since it did not match the requestMatcher %s",
81+
this.requestMatcher));
7882
}
79-
this.logger.debug(
80-
LogMessage.format("Not injecting Clear-Site-Data header since it did not match the requestMatcher %s",
81-
this.requestMatcher));
8283
}
8384

8485
private String transformToHeaderValue(Directive... directives) {

0 commit comments

Comments
 (0)