Merge branch '6.1.x'

This commit is contained in:
rstoyanchev
2024-10-16 12:11:23 +01:00
42 changed files with 97 additions and 74 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -51,7 +51,7 @@ public class ParameterContentTypeResolver implements RequestedContentTypeResolve
}
private static String formatKey(String key) {
return key.toLowerCase(Locale.ENGLISH);
return key.toLowerCase(Locale.ROOT);
}

View File

@@ -17,6 +17,7 @@
package org.springframework.web.reactive.function.client;
import java.io.IOException;
import java.util.Locale;
import java.util.regex.Pattern;
import io.micrometer.common.KeyValue;
@@ -92,7 +93,7 @@ public class DefaultClientRequestObservationConvention implements ClientRequestO
@Nullable
public String getContextualName(ClientRequestObservationContext context) {
ClientRequest request = context.getRequest();
return (request != null ? "http " + request.method().name().toLowerCase() : null);
return (request != null ? "http " + request.method().name().toLowerCase(Locale.ROOT) : null);
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.stream.Collectors;
import reactor.core.publisher.Mono;
@@ -140,7 +141,7 @@ public class CachingResourceResolver extends AbstractResourceResolver {
return Arrays.stream(StringUtils.tokenizeToStringArray(header, ","))
.map(token -> {
int index = token.indexOf(';');
return (index >= 0 ? token.substring(0, index) : token).trim().toLowerCase();
return (index >= 0 ? token.substring(0, index) : token).trim().toLowerCase(Locale.ROOT);
})
.filter(this.contentCodings::contains)
.sorted()

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,6 +28,7 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import reactor.core.publisher.Mono;
@@ -169,7 +170,7 @@ public class EncodedResourceResolver extends AbstractResourceResolver {
private String getAcceptEncoding(ServerWebExchange exchange) {
ServerHttpRequest request = exchange.getRequest();
String header = request.getHeaders().getFirst(HttpHeaders.ACCEPT_ENCODING);
return (header != null ? header.toLowerCase() : null);
return (header != null ? header.toLowerCase(Locale.ROOT) : null);
}
private String getExtension(String coding) {

View File

@@ -339,7 +339,7 @@ public class ResourceWebHandler implements WebHandler, InitializingBean {
this.mediaTypes = new HashMap<>(mediaTypes.size());
}
mediaTypes.forEach((ext, type) ->
this.mediaTypes.put(ext.toLowerCase(Locale.ENGLISH), type));
this.mediaTypes.put(ext.toLowerCase(Locale.ROOT), type));
}
/**
@@ -532,7 +532,7 @@ public class ResourceWebHandler implements WebHandler, InitializingBean {
if (!CollectionUtils.isEmpty(this.mediaTypes)) {
String ext = StringUtils.getFilenameExtension(filename);
if (ext != null) {
mediaType = this.mediaTypes.get(ext.toLowerCase(Locale.ENGLISH));
mediaType = this.mediaTypes.get(ext.toLowerCase(Locale.ROOT));
}
}
if (mediaType == null) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,6 +16,8 @@
package org.springframework.web.reactive.result.condition;
import java.util.Locale;
import org.springframework.lang.Nullable;
import org.springframework.util.ObjectUtils;
import org.springframework.web.server.ServerWebExchange;
@@ -106,7 +108,7 @@ abstract class AbstractNameValueExpression<T> implements NameValueExpression<T>
@Override
public int hashCode() {
int result = (isCaseSensitiveName() ? this.name : this.name.toLowerCase()).hashCode();
int result = (isCaseSensitiveName() ? this.name : this.name.toLowerCase(Locale.ROOT)).hashCode();
result = 31 * result + ObjectUtils.nullSafeHashCode(this.value);
result = 31 * result + (this.isNegated ? 1 : 0);
return result;