Skip to content

Commit 23656ae

Browse files
committed
Use Locale.ROOT consistently for toLower/toUpperCase
See gh-33708
1 parent feb6a5f commit 23656ae

File tree

43 files changed

+106
-82
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+106
-82
lines changed

framework-docs/src/main/java/org/springframework/docs/integration/observability/config/conventions/CustomServerRequestObservationConvention.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 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.
@@ -16,6 +16,8 @@
1616

1717
package org.springframework.docs.integration.observability.config.conventions;
1818

19+
import java.util.Locale;
20+
1921
import io.micrometer.common.KeyValue;
2022
import io.micrometer.common.KeyValues;
2123

@@ -34,7 +36,7 @@ public String getName() {
3436
@Override
3537
public String getContextualName(ServerRequestObservationContext context) {
3638
// will be used for the trace name
37-
return "http " + context.getCarrier().getMethod().toLowerCase();
39+
return "http " + context.getCarrier().getMethod().toLowerCase(Locale.ROOT);
3840
}
3941

4042
@Override

spring-context/src/main/java/org/springframework/validation/DataBinder.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import java.util.HashMap;
2828
import java.util.HashSet;
2929
import java.util.List;
30+
import java.util.Locale;
3031
import java.util.Map;
3132
import java.util.Optional;
3233
import java.util.Set;
@@ -568,7 +569,8 @@ public void setDisallowedFields(@Nullable String... disallowedFields) {
568569
else {
569570
String[] fieldPatterns = new String[disallowedFields.length];
570571
for (int i = 0; i < fieldPatterns.length; i++) {
571-
fieldPatterns[i] = PropertyAccessorUtils.canonicalPropertyName(disallowedFields[i]).toLowerCase();
572+
String field = PropertyAccessorUtils.canonicalPropertyName(disallowedFields[i]);
573+
fieldPatterns[i] = field.toLowerCase(Locale.ROOT);
572574
}
573575
this.disallowedFields = fieldPatterns;
574576
}
@@ -1157,7 +1159,7 @@ protected boolean isAllowed(String field) {
11571159
String[] allowed = getAllowedFields();
11581160
String[] disallowed = getDisallowedFields();
11591161
return ((ObjectUtils.isEmpty(allowed) || PatternMatchUtils.simpleMatch(allowed, field)) &&
1160-
(ObjectUtils.isEmpty(disallowed) || !PatternMatchUtils.simpleMatch(disallowed, field.toLowerCase())));
1162+
(ObjectUtils.isEmpty(disallowed) || !PatternMatchUtils.simpleMatch(disallowed, field.toLowerCase(Locale.ROOT))));
11611163
}
11621164

11631165
/**

spring-core/src/main/java/org/springframework/util/MimeType.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 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.
@@ -181,10 +181,10 @@ public MimeType(String type, String subtype, @Nullable Map<String, String> param
181181
Assert.hasLength(subtype, "'subtype' must not be empty");
182182
checkToken(type);
183183
checkToken(subtype);
184-
this.type = type.toLowerCase(Locale.ENGLISH);
185-
this.subtype = subtype.toLowerCase(Locale.ENGLISH);
184+
this.type = type.toLowerCase(Locale.ROOT);
185+
this.subtype = subtype.toLowerCase(Locale.ROOT);
186186
if (!CollectionUtils.isEmpty(parameters)) {
187-
Map<String, String> map = new LinkedCaseInsensitiveMap<>(parameters.size(), Locale.ENGLISH);
187+
Map<String, String> map = new LinkedCaseInsensitiveMap<>(parameters.size(), Locale.ROOT);
188188
parameters.forEach((parameter, value) -> {
189189
checkParameters(parameter, value);
190190
map.put(parameter, value);

spring-test/src/main/java/org/springframework/mock/web/MockHttpServletRequest.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,8 @@ public void setCharacterEncoding(@Nullable String characterEncoding) {
409409
private void updateContentTypeHeader() {
410410
if (StringUtils.hasLength(this.contentType)) {
411411
String value = this.contentType;
412-
if (StringUtils.hasLength(this.characterEncoding) && !this.contentType.toLowerCase().contains(CHARSET_PREFIX)) {
412+
if (StringUtils.hasLength(this.characterEncoding) &&
413+
!this.contentType.toLowerCase(Locale.ROOT).contains(CHARSET_PREFIX)) {
413414
value += ';' + CHARSET_PREFIX + this.characterEncoding;
414415
}
415416
doAddHeaderValue(HttpHeaders.CONTENT_TYPE, value, true);
@@ -487,7 +488,7 @@ public void setContentType(@Nullable String contentType) {
487488
}
488489
catch (IllegalArgumentException ex) {
489490
// Try to get charset value anyway
490-
contentType = contentType.toLowerCase();
491+
contentType = contentType.toLowerCase(Locale.ROOT);
491492
int charsetIndex = contentType.indexOf(CHARSET_PREFIX);
492493
if (charsetIndex != -1) {
493494
this.characterEncoding = contentType.substring(charsetIndex + CHARSET_PREFIX.length());

spring-test/src/main/java/org/springframework/mock/web/MockHttpServletResponse.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ private void setExplicitCharacterEncoding(@Nullable String characterEncoding) {
223223
}
224224
catch (Exception ignored) {
225225
String value = this.contentType;
226-
int charsetIndex = value.toLowerCase().indexOf(CHARSET_PREFIX);
226+
int charsetIndex = value.toLowerCase(Locale.ROOT).indexOf(CHARSET_PREFIX);
227227
if (charsetIndex != -1) {
228228
value = value.substring(0, charsetIndex).trim();
229229
if (value.endsWith(";")) {
@@ -243,7 +243,7 @@ private void setExplicitCharacterEncoding(@Nullable String characterEncoding) {
243243
private void updateContentTypePropertyAndHeader() {
244244
if (this.contentType != null) {
245245
String value = this.contentType;
246-
if (this.characterEncodingSet && !value.toLowerCase().contains(CHARSET_PREFIX)) {
246+
if (this.characterEncodingSet && !value.toLowerCase(Locale.ROOT).contains(CHARSET_PREFIX)) {
247247
value += ';' + CHARSET_PREFIX + getCharacterEncoding();
248248
this.contentType = value;
249249
}
@@ -351,7 +351,7 @@ public void setContentType(@Nullable String contentType) {
351351
}
352352
catch (Exception ex) {
353353
// Try to get charset value anyway
354-
int charsetIndex = contentType.toLowerCase().indexOf(CHARSET_PREFIX);
354+
int charsetIndex = contentType.toLowerCase(Locale.ROOT).indexOf(CHARSET_PREFIX);
355355
if (charsetIndex != -1) {
356356
setExplicitCharacterEncoding(contentType.substring(charsetIndex + CHARSET_PREFIX.length()));
357357
}

spring-web/src/main/java/org/springframework/http/HttpHeaders.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
392392
*/
393393
public static final HttpHeaders EMPTY = new ReadOnlyHttpHeaders(new LinkedMultiValueMap<>());
394394

395-
private static final DecimalFormatSymbols DECIMAL_FORMAT_SYMBOLS = new DecimalFormatSymbols(Locale.ENGLISH);
395+
private static final DecimalFormatSymbols DECIMAL_FORMAT_SYMBOLS = new DecimalFormatSymbols(Locale.ROOT);
396396

397397
private static final ZoneId GMT = ZoneId.of("GMT");
398398

@@ -422,7 +422,7 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
422422
* <p>This is the common constructor, using a case-insensitive map structure.
423423
*/
424424
public HttpHeaders() {
425-
this(CollectionUtils.toMultiValueMap(new LinkedCaseInsensitiveMap<>(8, Locale.ENGLISH)));
425+
this(CollectionUtils.toMultiValueMap(new LinkedCaseInsensitiveMap<>(8, Locale.ROOT)));
426426
}
427427

428428
/**
@@ -697,7 +697,7 @@ public HttpMethod getAccessControlRequestMethod() {
697697
public void setAcceptCharset(List<Charset> acceptableCharsets) {
698698
StringJoiner joiner = new StringJoiner(", ");
699699
for (Charset charset : acceptableCharsets) {
700-
joiner.add(charset.name().toLowerCase(Locale.ENGLISH));
700+
joiner.add(charset.name().toLowerCase(Locale.ROOT));
701701
}
702702
set(ACCEPT_CHARSET, joiner.toString());
703703
}

spring-web/src/main/java/org/springframework/http/MediaTypeFactory.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2024 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.
@@ -77,7 +77,7 @@ private static MultiValueMap<String, MediaType> parseMimeTypes() {
7777
String[] tokens = StringUtils.tokenizeToStringArray(line, " \t\n\r\f");
7878
MediaType mediaType = MediaType.parseMediaType(tokens[0]);
7979
for (int i = 1; i < tokens.length; i++) {
80-
String fileExtension = tokens[i].toLowerCase(Locale.ENGLISH);
80+
String fileExtension = tokens[i].toLowerCase(Locale.ROOT);
8181
result.add(fileExtension, mediaType);
8282
}
8383
}
@@ -117,7 +117,7 @@ public static List<MediaType> getMediaTypes(@Nullable String filename) {
117117
List<MediaType> mediaTypes = null;
118118
String ext = StringUtils.getFilenameExtension(filename);
119119
if (ext != null) {
120-
mediaTypes = fileExtensionToMediaTypes.get(ext.toLowerCase(Locale.ENGLISH));
120+
mediaTypes = fileExtensionToMediaTypes.get(ext.toLowerCase(Locale.ROOT));
121121
}
122122
return (mediaTypes != null ? mediaTypes : Collections.emptyList());
123123
}

spring-web/src/main/java/org/springframework/http/client/JdkClientHttpRequest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import java.nio.ByteBuffer;
2727
import java.time.Duration;
2828
import java.util.Collections;
29+
import java.util.Locale;
2930
import java.util.Set;
3031
import java.util.TreeSet;
3132
import java.util.concurrent.ExecutionException;
@@ -139,7 +140,7 @@ private HttpRequest buildRequest(HttpHeaders headers, @Nullable Body body) {
139140
}
140141

141142
headers.forEach((headerName, headerValues) -> {
142-
if (!DISALLOWED_HEADERS.contains(headerName.toLowerCase())) {
143+
if (!DISALLOWED_HEADERS.contains(headerName.toLowerCase(Locale.ROOT))) {
143144
for (String headerValue : headerValues) {
144145
builder.header(headerName, headerValue);
145146
}

spring-web/src/main/java/org/springframework/http/client/JdkClientHttpResponse.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public JdkClientHttpResponse(HttpResponse<InputStream> response) {
5757

5858
private static HttpHeaders adaptHeaders(HttpResponse<?> response) {
5959
Map<String, List<String>> rawHeaders = response.headers().map();
60-
Map<String, List<String>> map = new LinkedCaseInsensitiveMap<>(rawHeaders.size(), Locale.ENGLISH);
60+
Map<String, List<String>> map = new LinkedCaseInsensitiveMap<>(rawHeaders.size(), Locale.ROOT);
6161
MultiValueMap<String, String> multiValueMap = CollectionUtils.toMultiValueMap(map);
6262
multiValueMap.putAll(rawHeaders);
6363
return HttpHeaders.readOnlyHttpHeaders(multiValueMap);

spring-web/src/main/java/org/springframework/http/client/observation/DefaultClientRequestObservationConvention.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.springframework.http.client.observation;
1818

1919
import java.io.IOException;
20+
import java.util.Locale;
2021
import java.util.regex.Pattern;
2122

2223
import io.micrometer.common.KeyValue;
@@ -89,7 +90,7 @@ public String getName() {
8990
@Nullable
9091
public String getContextualName(ClientRequestObservationContext context) {
9192
ClientHttpRequest request = context.getCarrier();
92-
return (request != null ? "http " + request.getMethod().name().toLowerCase() : null);
93+
return (request != null ? "http " + request.getMethod().name().toLowerCase(Locale.ROOT) : null);
9394
}
9495

9596
@Override

spring-web/src/main/java/org/springframework/http/client/reactive/JdkClientHttpResponse.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public JdkClientHttpResponse(HttpResponse<Flow.Publisher<List<ByteBuffer>>> resp
6868

6969
private static HttpHeaders adaptHeaders(HttpResponse<Flow.Publisher<List<ByteBuffer>>> response) {
7070
Map<String, List<String>> rawHeaders = response.headers().map();
71-
Map<String, List<String>> map = new LinkedCaseInsensitiveMap<>(rawHeaders.size(), Locale.ENGLISH);
71+
Map<String, List<String>> map = new LinkedCaseInsensitiveMap<>(rawHeaders.size(), Locale.ROOT);
7272
MultiValueMap<String, String> multiValueMap = CollectionUtils.toMultiValueMap(map);
7373
multiValueMap.putAll(rawHeaders);
7474
return HttpHeaders.readOnlyHttpHeaders(multiValueMap);

spring-web/src/main/java/org/springframework/http/server/observation/DefaultServerRequestObservationConvention.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 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.
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.http.server.observation;
1818

19+
import java.util.Locale;
1920
import java.util.Set;
2021
import java.util.stream.Collectors;
2122
import java.util.stream.Stream;
@@ -89,7 +90,7 @@ public String getName() {
8990

9091
@Override
9192
public String getContextualName(ServerRequestObservationContext context) {
92-
String httpMethod = context.getCarrier().getMethod().toLowerCase();
93+
String httpMethod = context.getCarrier().getMethod().toLowerCase(Locale.ROOT);
9394
if (context.getPathPattern() != null) {
9495
return "http " + httpMethod + " " + context.getPathPattern();
9596
}

spring-web/src/main/java/org/springframework/http/server/reactive/ServletServerHttpRequest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 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.
@@ -111,7 +111,7 @@ public ServletServerHttpRequest(MultiValueMap<String, String> headers, HttpServl
111111

112112
private static MultiValueMap<String, String> createDefaultHttpHeaders(HttpServletRequest request) {
113113
MultiValueMap<String, String> headers =
114-
CollectionUtils.toMultiValueMap(new LinkedCaseInsensitiveMap<>(8, Locale.ENGLISH));
114+
CollectionUtils.toMultiValueMap(new LinkedCaseInsensitiveMap<>(8, Locale.ROOT));
115115
for (Enumeration<?> names = request.getHeaderNames(); names.hasMoreElements(); ) {
116116
String name = (String) names.nextElement();
117117
for (Enumeration<?> values = request.getHeaders(name); values.hasMoreElements(); ) {

spring-web/src/main/java/org/springframework/http/server/reactive/observation/DefaultServerRequestObservationConvention.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 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.
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.http.server.reactive.observation;
1818

19+
import java.util.Locale;
1920
import java.util.Set;
2021

2122
import io.micrometer.common.KeyValue;
@@ -87,7 +88,7 @@ public String getName() {
8788

8889
@Override
8990
public String getContextualName(ServerRequestObservationContext context) {
90-
String httpMethod = context.getCarrier().getMethod().name().toLowerCase();
91+
String httpMethod = context.getCarrier().getMethod().name().toLowerCase(Locale.ROOT);
9192
if (context.getPathPattern() != null) {
9293
return "http " + httpMethod + " " + context.getPathPattern();
9394
}

spring-web/src/main/java/org/springframework/web/accept/ContentNegotiationManagerFactoryBean.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2024 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.
@@ -214,7 +214,7 @@ public void setMediaTypes(Properties mediaTypes) {
214214
* An alternative to {@link #setMediaTypes} for programmatic registrations.
215215
*/
216216
public void addMediaType(String key, MediaType mediaType) {
217-
this.mediaTypes.put(key.toLowerCase(Locale.ENGLISH), mediaType);
217+
this.mediaTypes.put(key.toLowerCase(Locale.ROOT), mediaType);
218218
}
219219

220220
/**

spring-web/src/main/java/org/springframework/web/accept/MappingMediaTypeFileExtensionResolver.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public MappingMediaTypeFileExtensionResolver(@Nullable Map<String, MediaType> me
5757
if (mediaTypes != null) {
5858
Set<String> allFileExtensions = new HashSet<>(mediaTypes.size());
5959
mediaTypes.forEach((extension, mediaType) -> {
60-
String lowerCaseExtension = extension.toLowerCase(Locale.ENGLISH);
60+
String lowerCaseExtension = extension.toLowerCase(Locale.ROOT);
6161
this.mediaTypes.put(lowerCaseExtension, mediaType);
6262
addFileExtension(mediaType, lowerCaseExtension);
6363
allFileExtensions.add(lowerCaseExtension);
@@ -109,7 +109,7 @@ public List<String> getAllFileExtensions() {
109109
*/
110110
@Nullable
111111
protected MediaType lookupMediaType(String extension) {
112-
return this.mediaTypes.get(extension.toLowerCase(Locale.ENGLISH));
112+
return this.mediaTypes.get(extension.toLowerCase(Locale.ROOT));
113113
}
114114

115115
}

spring-web/src/main/java/org/springframework/web/accept/PathExtensionContentNegotiationStrategy.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2024 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.
@@ -99,7 +99,7 @@ protected String getMediaTypeKey(NativeWebRequest webRequest) {
9999
// Ignore LOOKUP_PATH attribute, use our own "fixed" UrlPathHelper with decoding off
100100
String path = this.urlPathHelper.getLookupPathForRequest(request);
101101
String extension = UriUtils.extractFileExtension(path);
102-
return (StringUtils.hasText(extension) ? extension.toLowerCase(Locale.ENGLISH) : null);
102+
return (StringUtils.hasText(extension) ? extension.toLowerCase(Locale.ROOT) : null);
103103
}
104104

105105
/**

spring-web/src/main/java/org/springframework/web/client/RestClientResponseException.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public RestClientResponseException(
105105
private static HttpHeaders copyHeaders(@Nullable HttpHeaders headers) {
106106
if (headers != null) {
107107
MultiValueMap<String, String> result =
108-
CollectionUtils.toMultiValueMap(new LinkedCaseInsensitiveMap<>(headers.size(), Locale.ENGLISH));
108+
CollectionUtils.toMultiValueMap(new LinkedCaseInsensitiveMap<>(headers.size(), Locale.ROOT));
109109
headers.forEach((name, values) -> values.forEach(value -> result.add(name, value)));
110110
return HttpHeaders.readOnlyHttpHeaders(result);
111111
}

spring-web/src/main/java/org/springframework/web/filter/ForwardedHeaderFilter.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public class ForwardedHeaderFilter extends OncePerRequestFilter {
8282
private static final Log logger = LogFactory.getLog(ForwardedHeaderFilter.class);
8383

8484
private static final Set<String> FORWARDED_HEADER_NAMES =
85-
Collections.newSetFromMap(new LinkedCaseInsensitiveMap<>(10, Locale.ENGLISH));
85+
Collections.newSetFromMap(new LinkedCaseInsensitiveMap<>(10, Locale.ROOT));
8686

8787
static {
8888
FORWARDED_HEADER_NAMES.add("Forwarded");
@@ -204,7 +204,7 @@ public ForwardedHeaderRemovingRequest(HttpServletRequest request) {
204204
}
205205

206206
private static Set<String> headerNames(HttpServletRequest request) {
207-
Set<String> headerNames = Collections.newSetFromMap(new LinkedCaseInsensitiveMap<>(Locale.ENGLISH));
207+
Set<String> headerNames = Collections.newSetFromMap(new LinkedCaseInsensitiveMap<>(Locale.ROOT));
208208
Enumeration<String> names = request.getHeaderNames();
209209
while (names.hasMoreElements()) {
210210
String name = names.nextElement();

spring-web/src/main/java/org/springframework/web/filter/HiddenHttpMethodFilter.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2024 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.
@@ -81,7 +81,7 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse
8181
if ("POST".equals(request.getMethod()) && request.getAttribute(WebUtils.ERROR_EXCEPTION_ATTRIBUTE) == null) {
8282
String paramValue = request.getParameter(this.methodParam);
8383
if (StringUtils.hasLength(paramValue)) {
84-
String method = paramValue.toUpperCase(Locale.ENGLISH);
84+
String method = paramValue.toUpperCase(Locale.ROOT);
8585
if (ALLOWED_METHODS.contains(method)) {
8686
requestToUse = new HttpMethodRequestWrapper(request, method);
8787
}

spring-web/src/main/java/org/springframework/web/filter/reactive/HiddenHttpMethodFilter.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2024 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.
@@ -88,7 +88,7 @@ public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) {
8888
}
8989

9090
private ServerWebExchange mapExchange(ServerWebExchange exchange, String methodParamValue) {
91-
HttpMethod httpMethod = HttpMethod.valueOf(methodParamValue.toUpperCase(Locale.ENGLISH));
91+
HttpMethod httpMethod = HttpMethod.valueOf(methodParamValue.toUpperCase(Locale.ROOT));
9292
if (ALLOWED_METHODS.contains(httpMethod)) {
9393
return exchange.mutate().request(builder -> builder.method(httpMethod)).build();
9494
}

0 commit comments

Comments
 (0)