Merge branch '6.1.x'

This commit is contained in:
Arjen Poutsma
2024-02-29 15:55:29 +01:00
2 changed files with 17 additions and 8 deletions

View File

@@ -526,10 +526,14 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
if (ranges.isEmpty()) {
return Collections.emptyList();
}
return ranges.stream()
.map(range -> Locale.forLanguageTag(range.getRange()))
.filter(locale -> StringUtils.hasText(locale.getDisplayName()))
.toList();
List<Locale> locales = new ArrayList<>(ranges.size());
for (Locale.LanguageRange range : ranges) {
if (!range.getRange().startsWith("*")) {
locales.add(Locale.forLanguageTag(range.getRange()));
}
}
return locales;
}
/**