Skip to content

Commit f847873

Browse files
committed
Log Request Mismatch Only When Mismatches
Signed-off-by: Joaquin Santana <joaquinjsb@outlook.com>
1 parent 07a50b4 commit f847873

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -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-
}
78-
}
77+
}
78+
return;
79+
}
7980
this.logger.debug(
80-
LogMessage.format("Not injecting Clear-Site-Data header since it did not match the requestMatcher %s",
81-
this.requestMatcher));
81+
LogMessage.format("Not injecting Clear-Site-Data header since it did not match the requestMatcher %s",
82+
this.requestMatcher));
8283
}
8384

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

0 commit comments

Comments
 (0)