Skip to content

Commit

Permalink
GH-3608: Use Locale.ROOT for neutral, case insensitive comparisons
Browse files Browse the repository at this point in the history
Fixes: #3608
Issue link: #3608

(cherry picked from commit 07cff76)

# Conflicts:
#	spring-kafka/src/main/java/org/springframework/kafka/annotation/KafkaListenerAnnotationBeanPostProcessor.java
  • Loading branch information
artembilan committed Oct 31, 2024
1 parent df7e38b commit 73addc6
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -352,13 +353,13 @@ protected SimplePatternBasedHeaderMatcher(String pattern) {

SimplePatternBasedHeaderMatcher(String pattern, boolean negate) {
Assert.notNull(pattern, "Pattern must no be null");
this.pattern = pattern.toLowerCase();
this.pattern = pattern.toLowerCase(Locale.ROOT);
this.negate = negate;
}

@Override
public boolean matchHeader(String headerName) {
String header = headerName.toLowerCase();
String header = headerName.toLowerCase(Locale.ROOT);
if (PatternMatchUtils.simpleMatch(this.pattern, header)) {
LOGGER.debug(() ->
MessageFormat.format(
Expand Down

0 comments on commit 73addc6

Please sign in to comment.