Merge branch '6.1.x'

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

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -16,6 +16,8 @@
package org.springframework.docs.integration.observability.config.conventions; package org.springframework.docs.integration.observability.config.conventions;
import java.util.Locale;
import io.micrometer.common.KeyValue; import io.micrometer.common.KeyValue;
import io.micrometer.common.KeyValues; import io.micrometer.common.KeyValues;
@ -34,7 +36,7 @@ public class CustomServerRequestObservationConvention implements ServerRequestOb
@Override @Override
public String getContextualName(ServerRequestObservationContext context) { public String getContextualName(ServerRequestObservationContext context) {
// will be used for the trace name // will be used for the trace name
return "http " + context.getCarrier().getMethod().toLowerCase(); return "http " + context.getCarrier().getMethod().toLowerCase(Locale.ROOT);
} }
@Override @Override

View File

@ -27,6 +27,7 @@ import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
import java.util.Set; import java.util.Set;
@ -570,7 +571,8 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter {
else { else {
String[] fieldPatterns = new String[disallowedFields.length]; String[] fieldPatterns = new String[disallowedFields.length];
for (int i = 0; i < fieldPatterns.length; i++) { for (int i = 0; i < fieldPatterns.length; i++) {
fieldPatterns[i] = PropertyAccessorUtils.canonicalPropertyName(disallowedFields[i]).toLowerCase(); String field = PropertyAccessorUtils.canonicalPropertyName(disallowedFields[i]);
fieldPatterns[i] = field.toLowerCase(Locale.ROOT);
} }
this.disallowedFields = fieldPatterns; this.disallowedFields = fieldPatterns;
} }
@ -1248,7 +1250,7 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter {
String[] allowed = getAllowedFields(); String[] allowed = getAllowedFields();
String[] disallowed = getDisallowedFields(); String[] disallowed = getDisallowedFields();
return ((ObjectUtils.isEmpty(allowed) || PatternMatchUtils.simpleMatch(allowed, field)) && return ((ObjectUtils.isEmpty(allowed) || PatternMatchUtils.simpleMatch(allowed, field)) &&
(ObjectUtils.isEmpty(disallowed) || !PatternMatchUtils.simpleMatch(disallowed, field.toLowerCase()))); (ObjectUtils.isEmpty(disallowed) || !PatternMatchUtils.simpleMatch(disallowed, field.toLowerCase(Locale.ROOT))));
} }
/** /**

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -181,10 +181,10 @@ public class MimeType implements Comparable<MimeType>, Serializable {
Assert.hasLength(subtype, "'subtype' must not be empty"); Assert.hasLength(subtype, "'subtype' must not be empty");
checkToken(type); checkToken(type);
checkToken(subtype); checkToken(subtype);
this.type = type.toLowerCase(Locale.ENGLISH); this.type = type.toLowerCase(Locale.ROOT);
this.subtype = subtype.toLowerCase(Locale.ENGLISH); this.subtype = subtype.toLowerCase(Locale.ROOT);
if (!CollectionUtils.isEmpty(parameters)) { if (!CollectionUtils.isEmpty(parameters)) {
Map<String, String> map = new LinkedCaseInsensitiveMap<>(parameters.size(), Locale.ENGLISH); Map<String, String> map = new LinkedCaseInsensitiveMap<>(parameters.size(), Locale.ROOT);
parameters.forEach((parameter, value) -> { parameters.forEach((parameter, value) -> {
checkParameters(parameter, value); checkParameters(parameter, value);
map.put(parameter, value); map.put(parameter, value);

View File

@ -412,7 +412,8 @@ public class MockHttpServletRequest implements HttpServletRequest {
private void updateContentTypeHeader() { private void updateContentTypeHeader() {
if (StringUtils.hasLength(this.contentType)) { if (StringUtils.hasLength(this.contentType)) {
String value = this.contentType; String value = this.contentType;
if (StringUtils.hasLength(this.characterEncoding) && !this.contentType.toLowerCase().contains(CHARSET_PREFIX)) { if (StringUtils.hasLength(this.characterEncoding) &&
!this.contentType.toLowerCase(Locale.ROOT).contains(CHARSET_PREFIX)) {
value += ';' + CHARSET_PREFIX + this.characterEncoding; value += ';' + CHARSET_PREFIX + this.characterEncoding;
} }
doAddHeaderValue(HttpHeaders.CONTENT_TYPE, value, true); doAddHeaderValue(HttpHeaders.CONTENT_TYPE, value, true);
@ -490,7 +491,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
} }
catch (IllegalArgumentException ex) { catch (IllegalArgumentException ex) {
// Try to get charset value anyway // Try to get charset value anyway
contentType = contentType.toLowerCase(); contentType = contentType.toLowerCase(Locale.ROOT);
int charsetIndex = contentType.indexOf(CHARSET_PREFIX); int charsetIndex = contentType.indexOf(CHARSET_PREFIX);
if (charsetIndex != -1) { if (charsetIndex != -1) {
this.characterEncoding = contentType.substring(charsetIndex + CHARSET_PREFIX.length()); this.characterEncoding = contentType.substring(charsetIndex + CHARSET_PREFIX.length());

View File

@ -226,7 +226,7 @@ public class MockHttpServletResponse implements HttpServletResponse {
} }
catch (Exception ignored) { catch (Exception ignored) {
String value = this.contentType; String value = this.contentType;
int charsetIndex = value.toLowerCase().indexOf(CHARSET_PREFIX); int charsetIndex = value.toLowerCase(Locale.ROOT).indexOf(CHARSET_PREFIX);
if (charsetIndex != -1) { if (charsetIndex != -1) {
value = value.substring(0, charsetIndex).trim(); value = value.substring(0, charsetIndex).trim();
if (value.endsWith(";")) { if (value.endsWith(";")) {
@ -246,7 +246,7 @@ public class MockHttpServletResponse implements HttpServletResponse {
private void updateContentTypePropertyAndHeader() { private void updateContentTypePropertyAndHeader() {
if (this.contentType != null) { if (this.contentType != null) {
String value = this.contentType; String value = this.contentType;
if (this.characterEncodingSet && !value.toLowerCase().contains(CHARSET_PREFIX)) { if (this.characterEncodingSet && !value.toLowerCase(Locale.ROOT).contains(CHARSET_PREFIX)) {
value += ';' + CHARSET_PREFIX + getCharacterEncoding(); value += ';' + CHARSET_PREFIX + getCharacterEncoding();
this.contentType = value; this.contentType = value;
} }
@ -358,7 +358,7 @@ public class MockHttpServletResponse implements HttpServletResponse {
} }
catch (Exception ex) { catch (Exception ex) {
// Try to get charset value anyway // Try to get charset value anyway
int charsetIndex = contentType.toLowerCase().indexOf(CHARSET_PREFIX); int charsetIndex = contentType.toLowerCase(Locale.ROOT).indexOf(CHARSET_PREFIX);
if (charsetIndex != -1) { if (charsetIndex != -1) {
setExplicitCharacterEncoding(contentType.substring(charsetIndex + CHARSET_PREFIX.length())); setExplicitCharacterEncoding(contentType.substring(charsetIndex + CHARSET_PREFIX.length()));
} }

View File

@ -391,7 +391,7 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
*/ */
public static final HttpHeaders EMPTY = new ReadOnlyHttpHeaders(new LinkedMultiValueMap<>()); public static final HttpHeaders EMPTY = new ReadOnlyHttpHeaders(new LinkedMultiValueMap<>());
private static final DecimalFormatSymbols DECIMAL_FORMAT_SYMBOLS = new DecimalFormatSymbols(Locale.ENGLISH); private static final DecimalFormatSymbols DECIMAL_FORMAT_SYMBOLS = new DecimalFormatSymbols(Locale.ROOT);
private static final ZoneId GMT = ZoneId.of("GMT"); private static final ZoneId GMT = ZoneId.of("GMT");
@ -421,7 +421,7 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
* <p>This is the common constructor, using a case-insensitive map structure. * <p>This is the common constructor, using a case-insensitive map structure.
*/ */
public HttpHeaders() { public HttpHeaders() {
this(CollectionUtils.toMultiValueMap(new LinkedCaseInsensitiveMap<>(8, Locale.ENGLISH))); this(CollectionUtils.toMultiValueMap(new LinkedCaseInsensitiveMap<>(8, Locale.ROOT)));
} }
/** /**
@ -717,7 +717,7 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
public void setAcceptCharset(List<Charset> acceptableCharsets) { public void setAcceptCharset(List<Charset> acceptableCharsets) {
StringJoiner joiner = new StringJoiner(", "); StringJoiner joiner = new StringJoiner(", ");
for (Charset charset : acceptableCharsets) { for (Charset charset : acceptableCharsets) {
joiner.add(charset.name().toLowerCase(Locale.ENGLISH)); joiner.add(charset.name().toLowerCase(Locale.ROOT));
} }
set(ACCEPT_CHARSET, joiner.toString()); set(ACCEPT_CHARSET, joiner.toString());
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2021 the original author or authors. * Copyright 2002-2024 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -77,7 +77,7 @@ public final class MediaTypeFactory {
String[] tokens = StringUtils.tokenizeToStringArray(line, " \t\n\r\f"); String[] tokens = StringUtils.tokenizeToStringArray(line, " \t\n\r\f");
MediaType mediaType = MediaType.parseMediaType(tokens[0]); MediaType mediaType = MediaType.parseMediaType(tokens[0]);
for (int i = 1; i < tokens.length; i++) { for (int i = 1; i < tokens.length; i++) {
String fileExtension = tokens[i].toLowerCase(Locale.ENGLISH); String fileExtension = tokens[i].toLowerCase(Locale.ROOT);
result.add(fileExtension, mediaType); result.add(fileExtension, mediaType);
} }
} }
@ -117,7 +117,7 @@ public final class MediaTypeFactory {
List<MediaType> mediaTypes = null; List<MediaType> mediaTypes = null;
String ext = StringUtils.getFilenameExtension(filename); String ext = StringUtils.getFilenameExtension(filename);
if (ext != null) { if (ext != null) {
mediaTypes = fileExtensionToMediaTypes.get(ext.toLowerCase(Locale.ENGLISH)); mediaTypes = fileExtensionToMediaTypes.get(ext.toLowerCase(Locale.ROOT));
} }
return (mediaTypes != null ? mediaTypes : Collections.emptyList()); return (mediaTypes != null ? mediaTypes : Collections.emptyList());
} }

View File

@ -28,6 +28,7 @@ import java.net.http.HttpTimeoutException;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.time.Duration; import java.time.Duration;
import java.util.Collections; import java.util.Collections;
import java.util.Locale;
import java.util.Set; import java.util.Set;
import java.util.TreeSet; import java.util.TreeSet;
import java.util.concurrent.CancellationException; import java.util.concurrent.CancellationException;
@ -141,7 +142,7 @@ class JdkClientHttpRequest extends AbstractStreamingClientHttpRequest {
HttpRequest.Builder builder = HttpRequest.newBuilder().uri(this.uri); HttpRequest.Builder builder = HttpRequest.newBuilder().uri(this.uri);
headers.forEach((headerName, headerValues) -> { headers.forEach((headerName, headerValues) -> {
if (!DISALLOWED_HEADERS.contains(headerName.toLowerCase())) { if (!DISALLOWED_HEADERS.contains(headerName.toLowerCase(Locale.ROOT))) {
for (String headerValue : headerValues) { for (String headerValue : headerValues) {
builder.header(headerName, headerValue); builder.header(headerName, headerValue);
} }

View File

@ -57,7 +57,7 @@ class JdkClientHttpResponse implements ClientHttpResponse {
private static HttpHeaders adaptHeaders(HttpResponse<?> response) { private static HttpHeaders adaptHeaders(HttpResponse<?> response) {
Map<String, List<String>> rawHeaders = response.headers().map(); Map<String, List<String>> rawHeaders = response.headers().map();
Map<String, List<String>> map = new LinkedCaseInsensitiveMap<>(rawHeaders.size(), Locale.ENGLISH); Map<String, List<String>> map = new LinkedCaseInsensitiveMap<>(rawHeaders.size(), Locale.ROOT);
MultiValueMap<String, String> multiValueMap = CollectionUtils.toMultiValueMap(map); MultiValueMap<String, String> multiValueMap = CollectionUtils.toMultiValueMap(map);
multiValueMap.putAll(rawHeaders); multiValueMap.putAll(rawHeaders);
return HttpHeaders.readOnlyHttpHeaders(multiValueMap); return HttpHeaders.readOnlyHttpHeaders(multiValueMap);

View File

@ -17,6 +17,7 @@
package org.springframework.http.client.observation; package org.springframework.http.client.observation;
import java.io.IOException; import java.io.IOException;
import java.util.Locale;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import io.micrometer.common.KeyValue; import io.micrometer.common.KeyValue;
@ -89,7 +90,7 @@ public class DefaultClientRequestObservationConvention implements ClientRequestO
@Nullable @Nullable
public String getContextualName(ClientRequestObservationContext context) { public String getContextualName(ClientRequestObservationContext context) {
ClientHttpRequest request = context.getCarrier(); ClientHttpRequest request = context.getCarrier();
return (request != null ? "http " + request.getMethod().name().toLowerCase() : null); return (request != null ? "http " + request.getMethod().name().toLowerCase(Locale.ROOT) : null);
} }
@Override @Override

View File

@ -68,7 +68,7 @@ class JdkClientHttpResponse extends AbstractClientHttpResponse {
private static HttpHeaders adaptHeaders(HttpResponse<Flow.Publisher<List<ByteBuffer>>> response) { private static HttpHeaders adaptHeaders(HttpResponse<Flow.Publisher<List<ByteBuffer>>> response) {
Map<String, List<String>> rawHeaders = response.headers().map(); Map<String, List<String>> rawHeaders = response.headers().map();
Map<String, List<String>> map = new LinkedCaseInsensitiveMap<>(rawHeaders.size(), Locale.ENGLISH); Map<String, List<String>> map = new LinkedCaseInsensitiveMap<>(rawHeaders.size(), Locale.ROOT);
MultiValueMap<String, String> multiValueMap = CollectionUtils.toMultiValueMap(map); MultiValueMap<String, String> multiValueMap = CollectionUtils.toMultiValueMap(map);
multiValueMap.putAll(rawHeaders); multiValueMap.putAll(rawHeaders);
return HttpHeaders.readOnlyHttpHeaders(multiValueMap); return HttpHeaders.readOnlyHttpHeaders(multiValueMap);

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -16,6 +16,7 @@
package org.springframework.http.server.observation; package org.springframework.http.server.observation;
import java.util.Locale;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@ -89,7 +90,7 @@ public class DefaultServerRequestObservationConvention implements ServerRequestO
@Override @Override
public String getContextualName(ServerRequestObservationContext context) { public String getContextualName(ServerRequestObservationContext context) {
String httpMethod = context.getCarrier().getMethod().toLowerCase(); String httpMethod = context.getCarrier().getMethod().toLowerCase(Locale.ROOT);
if (context.getPathPattern() != null) { if (context.getPathPattern() != null) {
return "http " + httpMethod + " " + context.getPathPattern(); return "http " + httpMethod + " " + context.getPathPattern();
} }

View File

@ -112,7 +112,7 @@ class ServletServerHttpRequest extends AbstractServerHttpRequest {
private static MultiValueMap<String, String> createDefaultHttpHeaders(HttpServletRequest request) { private static MultiValueMap<String, String> createDefaultHttpHeaders(HttpServletRequest request) {
MultiValueMap<String, String> headers = MultiValueMap<String, String> headers =
CollectionUtils.toMultiValueMap(new LinkedCaseInsensitiveMap<>(8, Locale.ENGLISH)); CollectionUtils.toMultiValueMap(new LinkedCaseInsensitiveMap<>(8, Locale.ROOT));
for (Enumeration<?> names = request.getHeaderNames(); names.hasMoreElements(); ) { for (Enumeration<?> names = request.getHeaderNames(); names.hasMoreElements(); ) {
String name = (String) names.nextElement(); String name = (String) names.nextElement();
for (Enumeration<?> values = request.getHeaders(name); values.hasMoreElements(); ) { for (Enumeration<?> values = request.getHeaders(name); values.hasMoreElements(); ) {

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -16,6 +16,7 @@
package org.springframework.http.server.reactive.observation; package org.springframework.http.server.reactive.observation;
import java.util.Locale;
import java.util.Set; import java.util.Set;
import io.micrometer.common.KeyValue; import io.micrometer.common.KeyValue;
@ -87,7 +88,7 @@ public class DefaultServerRequestObservationConvention implements ServerRequestO
@Override @Override
public String getContextualName(ServerRequestObservationContext context) { public String getContextualName(ServerRequestObservationContext context) {
String httpMethod = context.getCarrier().getMethod().name().toLowerCase(); String httpMethod = context.getCarrier().getMethod().name().toLowerCase(Locale.ROOT);
if (context.getPathPattern() != null) { if (context.getPathPattern() != null) {
return "http " + httpMethod + " " + context.getPathPattern(); return "http " + httpMethod + " " + context.getPathPattern();
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2021 the original author or authors. * Copyright 2002-2024 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -214,7 +214,7 @@ public class ContentNegotiationManagerFactoryBean
* An alternative to {@link #setMediaTypes} for programmatic registrations. * An alternative to {@link #setMediaTypes} for programmatic registrations.
*/ */
public void addMediaType(String key, MediaType mediaType) { public void addMediaType(String key, MediaType mediaType) {
this.mediaTypes.put(key.toLowerCase(Locale.ENGLISH), mediaType); this.mediaTypes.put(key.toLowerCase(Locale.ROOT), mediaType);
} }
/** /**

View File

@ -57,7 +57,7 @@ public class MappingMediaTypeFileExtensionResolver implements MediaTypeFileExten
if (mediaTypes != null) { if (mediaTypes != null) {
Set<String> allFileExtensions = CollectionUtils.newHashSet(mediaTypes.size()); Set<String> allFileExtensions = CollectionUtils.newHashSet(mediaTypes.size());
mediaTypes.forEach((extension, mediaType) -> { mediaTypes.forEach((extension, mediaType) -> {
String lowerCaseExtension = extension.toLowerCase(Locale.ENGLISH); String lowerCaseExtension = extension.toLowerCase(Locale.ROOT);
this.mediaTypes.put(lowerCaseExtension, mediaType); this.mediaTypes.put(lowerCaseExtension, mediaType);
addFileExtension(mediaType, lowerCaseExtension); addFileExtension(mediaType, lowerCaseExtension);
allFileExtensions.add(lowerCaseExtension); allFileExtensions.add(lowerCaseExtension);
@ -109,7 +109,7 @@ public class MappingMediaTypeFileExtensionResolver implements MediaTypeFileExten
*/ */
@Nullable @Nullable
protected MediaType lookupMediaType(String extension) { protected MediaType lookupMediaType(String extension) {
return this.mediaTypes.get(extension.toLowerCase(Locale.ENGLISH)); return this.mediaTypes.get(extension.toLowerCase(Locale.ROOT));
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2020 the original author or authors. * Copyright 2002-2024 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -99,7 +99,7 @@ public class PathExtensionContentNegotiationStrategy extends AbstractMappingCont
// Ignore LOOKUP_PATH attribute, use our own "fixed" UrlPathHelper with decoding off // Ignore LOOKUP_PATH attribute, use our own "fixed" UrlPathHelper with decoding off
String path = this.urlPathHelper.getLookupPathForRequest(request); String path = this.urlPathHelper.getLookupPathForRequest(request);
String extension = UriUtils.extractFileExtension(path); String extension = UriUtils.extractFileExtension(path);
return (StringUtils.hasText(extension) ? extension.toLowerCase(Locale.ENGLISH) : null); return (StringUtils.hasText(extension) ? extension.toLowerCase(Locale.ROOT) : null);
} }
/** /**

View File

@ -105,7 +105,7 @@ public class RestClientResponseException extends RestClientException {
private static HttpHeaders copyHeaders(@Nullable HttpHeaders headers) { private static HttpHeaders copyHeaders(@Nullable HttpHeaders headers) {
if (headers != null) { if (headers != null) {
MultiValueMap<String, String> result = MultiValueMap<String, String> result =
CollectionUtils.toMultiValueMap(new LinkedCaseInsensitiveMap<>(headers.size(), Locale.ENGLISH)); CollectionUtils.toMultiValueMap(new LinkedCaseInsensitiveMap<>(headers.size(), Locale.ROOT));
headers.forEach((name, values) -> values.forEach(value -> result.add(name, value))); headers.forEach((name, values) -> values.forEach(value -> result.add(name, value)));
return HttpHeaders.readOnlyHttpHeaders(result); return HttpHeaders.readOnlyHttpHeaders(result);
} }

View File

@ -82,7 +82,7 @@ public class ForwardedHeaderFilter extends OncePerRequestFilter {
private static final Log logger = LogFactory.getLog(ForwardedHeaderFilter.class); private static final Log logger = LogFactory.getLog(ForwardedHeaderFilter.class);
private static final Set<String> FORWARDED_HEADER_NAMES = private static final Set<String> FORWARDED_HEADER_NAMES =
Collections.newSetFromMap(new LinkedCaseInsensitiveMap<>(10, Locale.ENGLISH)); Collections.newSetFromMap(new LinkedCaseInsensitiveMap<>(10, Locale.ROOT));
static { static {
FORWARDED_HEADER_NAMES.add("Forwarded"); FORWARDED_HEADER_NAMES.add("Forwarded");
@ -204,7 +204,7 @@ public class ForwardedHeaderFilter extends OncePerRequestFilter {
} }
private static Set<String> headerNames(HttpServletRequest request) { private static Set<String> headerNames(HttpServletRequest request) {
Set<String> headerNames = Collections.newSetFromMap(new LinkedCaseInsensitiveMap<>(Locale.ENGLISH)); Set<String> headerNames = Collections.newSetFromMap(new LinkedCaseInsensitiveMap<>(Locale.ROOT));
Enumeration<String> names = request.getHeaderNames(); Enumeration<String> names = request.getHeaderNames();
while (names.hasMoreElements()) { while (names.hasMoreElements()) {
String name = names.nextElement(); String name = names.nextElement();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2021 the original author or authors. * Copyright 2002-2024 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -81,7 +81,7 @@ public class HiddenHttpMethodFilter extends OncePerRequestFilter {
if ("POST".equals(request.getMethod()) && request.getAttribute(WebUtils.ERROR_EXCEPTION_ATTRIBUTE) == null) { if ("POST".equals(request.getMethod()) && request.getAttribute(WebUtils.ERROR_EXCEPTION_ATTRIBUTE) == null) {
String paramValue = request.getParameter(this.methodParam); String paramValue = request.getParameter(this.methodParam);
if (StringUtils.hasLength(paramValue)) { if (StringUtils.hasLength(paramValue)) {
String method = paramValue.toUpperCase(Locale.ENGLISH); String method = paramValue.toUpperCase(Locale.ROOT);
if (ALLOWED_METHODS.contains(method)) { if (ALLOWED_METHODS.contains(method)) {
requestToUse = new HttpMethodRequestWrapper(request, method); requestToUse = new HttpMethodRequestWrapper(request, method);
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2021 the original author or authors. * Copyright 2002-2024 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -88,7 +88,7 @@ public class HiddenHttpMethodFilter implements WebFilter {
} }
private ServerWebExchange mapExchange(ServerWebExchange exchange, String methodParamValue) { private ServerWebExchange mapExchange(ServerWebExchange exchange, String methodParamValue) {
HttpMethod httpMethod = HttpMethod.valueOf(methodParamValue.toUpperCase(Locale.ENGLISH)); HttpMethod httpMethod = HttpMethod.valueOf(methodParamValue.toUpperCase(Locale.ROOT));
if (ALLOWED_METHODS.contains(httpMethod)) { if (ALLOWED_METHODS.contains(httpMethod)) {
return exchange.mutate().request(builder -> builder.method(httpMethod)).build(); return exchange.mutate().request(builder -> builder.method(httpMethod)).build();
} }

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -19,6 +19,7 @@ package org.springframework.web.multipart.support;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Locale;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.Part; import jakarta.servlet.http.Part;
@ -71,7 +72,7 @@ public final class MultipartResolutionDelegate {
private static boolean isMultipartContent(HttpServletRequest request) { private static boolean isMultipartContent(HttpServletRequest request) {
String contentType = request.getContentType(); String contentType = request.getContentType();
return (contentType != null && contentType.toLowerCase().startsWith("multipart/")); return (contentType != null && contentType.toLowerCase(Locale.ROOT).startsWith("multipart/"));
} }
static MultipartHttpServletRequest asMultipartHttpServletRequest(HttpServletRequest request) { static MultipartHttpServletRequest asMultipartHttpServletRequest(HttpServletRequest request) {

View File

@ -28,6 +28,7 @@ import java.util.Collections;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.LinkedHashSet; import java.util.LinkedHashSet;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@ -118,7 +119,7 @@ public class StandardMultipartHttpServletRequest extends AbstractMultipartHttpSe
do { do {
String msg = cause.getMessage(); String msg = cause.getMessage();
if (msg != null) { if (msg != null) {
msg = msg.toLowerCase(); msg = msg.toLowerCase(Locale.ROOT);
if ((msg.contains("exceed") && (msg.contains("size") || msg.contains("length"))) || if ((msg.contains("exceed") && (msg.contains("size") || msg.contains("length"))) ||
(msg.contains("request") && (msg.contains("big") || msg.contains("large")))) { (msg.contains("request") && (msg.contains("big") || msg.contains("large")))) {
throw new MaxUploadSizeExceededException(-1, ex); throw new MaxUploadSizeExceededException(-1, ex);

View File

@ -61,7 +61,7 @@ import org.springframework.web.util.UriComponents;
public class ForwardedHeaderTransformer implements Function<ServerHttpRequest, ServerHttpRequest> { public class ForwardedHeaderTransformer implements Function<ServerHttpRequest, ServerHttpRequest> {
static final Set<String> FORWARDED_HEADER_NAMES = static final Set<String> FORWARDED_HEADER_NAMES =
Collections.newSetFromMap(new LinkedCaseInsensitiveMap<>(10, Locale.ENGLISH)); Collections.newSetFromMap(new LinkedCaseInsensitiveMap<>(10, Locale.ROOT));
static { static {
FORWARDED_HEADER_NAMES.add("Forwarded"); FORWARDED_HEADER_NAMES.add("Forwarded");

View File

@ -16,6 +16,7 @@
package org.springframework.web.util; package org.springframework.web.util;
import java.util.Locale;
import java.util.Set; import java.util.Set;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
@ -84,7 +85,7 @@ public class DisconnectedClientHelper {
public static boolean isClientDisconnectedException(Throwable ex) { public static boolean isClientDisconnectedException(Throwable ex) {
String message = NestedExceptionUtils.getMostSpecificCause(ex).getMessage(); String message = NestedExceptionUtils.getMostSpecificCause(ex).getMessage();
if (message != null) { if (message != null) {
String text = message.toLowerCase(); String text = message.toLowerCase(Locale.ROOT);
for (String phrase : EXCEPTION_PHRASES) { for (String phrase : EXCEPTION_PHRASES) {
if (text.contains(phrase)) { if (text.contains(phrase)) {
return true; return true;

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -18,6 +18,7 @@ package org.springframework.web.util;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.nio.charset.UnsupportedCharsetException; import java.nio.charset.UnsupportedCharsetException;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
@ -629,7 +630,7 @@ public class UrlPathHelper {
private String removeJsessionid(String requestUri) { private String removeJsessionid(String requestUri) {
String key = ";jsessionid="; String key = ";jsessionid=";
int index = requestUri.toLowerCase().indexOf(key); int index = requestUri.toLowerCase(Locale.ROOT).indexOf(key);
if (index == -1) { if (index == -1) {
return requestUri; return requestUri;
} }

View File

@ -169,7 +169,7 @@ abstract class AbstractHttpRequestFactoryTests extends AbstractMockWebServerTest
try (ClientHttpResponse response = request.execute()) { try (ClientHttpResponse response = request.execute()) {
assertThat(response.getStatusCode()).as("Invalid response status").isEqualTo(HttpStatus.OK); assertThat(response.getStatusCode()).as("Invalid response status").isEqualTo(HttpStatus.OK);
assertThat(request.getMethod().name()).as("Invalid method").isEqualTo(path.toUpperCase(Locale.ENGLISH)); assertThat(request.getMethod().name()).as("Invalid method").isEqualTo(path.toUpperCase(Locale.ROOT));
} }
} }

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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) { 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; package org.springframework.web.reactive.function.client;
import java.io.IOException; import java.io.IOException;
import java.util.Locale;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import io.micrometer.common.KeyValue; import io.micrometer.common.KeyValue;
@ -92,7 +93,7 @@ public class DefaultClientRequestObservationConvention implements ClientRequestO
@Nullable @Nullable
public String getContextualName(ClientRequestObservationContext context) { public String getContextualName(ClientRequestObservationContext context) {
ClientRequest request = context.getRequest(); 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 @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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;
@ -140,7 +141,7 @@ public class CachingResourceResolver extends AbstractResourceResolver {
return Arrays.stream(StringUtils.tokenizeToStringArray(header, ",")) return Arrays.stream(StringUtils.tokenizeToStringArray(header, ","))
.map(token -> { .map(token -> {
int index = token.indexOf(';'); 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) .filter(this.contentCodings::contains)
.sorted() .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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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.Collections;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;
@ -169,7 +170,7 @@ public class EncodedResourceResolver extends AbstractResourceResolver {
private String getAcceptEncoding(ServerWebExchange exchange) { private String getAcceptEncoding(ServerWebExchange exchange) {
ServerHttpRequest request = exchange.getRequest(); ServerHttpRequest request = exchange.getRequest();
String header = request.getHeaders().getFirst(HttpHeaders.ACCEPT_ENCODING); 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) { private String getExtension(String coding) {

View File

@ -339,7 +339,7 @@ public class ResourceWebHandler implements WebHandler, InitializingBean {
this.mediaTypes = new HashMap<>(mediaTypes.size()); this.mediaTypes = new HashMap<>(mediaTypes.size());
} }
mediaTypes.forEach((ext, type) -> 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)) { if (!CollectionUtils.isEmpty(this.mediaTypes)) {
String ext = StringUtils.getFilenameExtension(filename); String ext = StringUtils.getFilenameExtension(filename);
if (ext != null) { if (ext != null) {
mediaType = this.mediaTypes.get(ext.toLowerCase(Locale.ENGLISH)); mediaType = this.mediaTypes.get(ext.toLowerCase(Locale.ROOT));
} }
} }
if (mediaType == null) { 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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; package org.springframework.web.reactive.result.condition;
import java.util.Locale;
import org.springframework.lang.Nullable; import org.springframework.lang.Nullable;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.server.ServerWebExchange; import org.springframework.web.server.ServerWebExchange;
@ -106,7 +108,7 @@ abstract class AbstractNameValueExpression<T> implements NameValueExpression<T>
@Override @Override
public int hashCode() { 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 + ObjectUtils.nullSafeHashCode(this.value);
result = 31 * result + (this.isNegated ? 1 : 0); result = 31 * result + (this.isNegated ? 1 : 0);
return result; return result;

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -16,6 +16,8 @@
package org.springframework.web.servlet.mvc.condition; package org.springframework.web.servlet.mvc.condition;
import java.util.Locale;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import org.springframework.lang.Nullable; import org.springframework.lang.Nullable;
@ -108,7 +110,7 @@ abstract class AbstractNameValueExpression<T> implements NameValueExpression<T>
@Override @Override
public int hashCode() { public int hashCode() {
int result = (isCaseSensitiveName() ? this.name.hashCode() : this.name.toLowerCase().hashCode()); int result = (isCaseSensitiveName() ? this.name.hashCode() : this.name.toLowerCase(Locale.ROOT).hashCode());
result = 31 * result + (this.value != null ? this.value.hashCode() : 0); result = 31 * result + (this.value != null ? this.value.hashCode() : 0);
result = 31 * result + (this.isNegated ? 1 : 0); result = 31 * result + (this.isNegated ? 1 : 0);
return result; return result;

View File

@ -532,7 +532,7 @@ public abstract class AbstractMessageConverterMethodProcessor extends AbstractMe
if (!StringUtils.hasText(extension)) { if (!StringUtils.hasText(extension)) {
return true; return true;
} }
extension = extension.toLowerCase(Locale.ENGLISH); extension = extension.toLowerCase(Locale.ROOT);
if (this.safeExtensions.contains(extension)) { if (this.safeExtensions.contains(extension)) {
return true; return true;
} }

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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
@ -147,7 +148,7 @@ public class CachingResourceResolver extends AbstractResourceResolver {
return Arrays.stream(StringUtils.tokenizeToStringArray(header, ",")) return Arrays.stream(StringUtils.tokenizeToStringArray(header, ","))
.map(token -> { .map(token -> {
int index = token.indexOf(';'); 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) .filter(this.contentCodings::contains)
.sorted() .sorted()

View File

@ -28,6 +28,7 @@ import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
@ -166,7 +167,7 @@ public class EncodedResourceResolver extends AbstractResourceResolver {
@Nullable @Nullable
private String getAcceptEncoding(HttpServletRequest request) { private String getAcceptEncoding(HttpServletRequest request) {
String header = request.getHeader(HttpHeaders.ACCEPT_ENCODING); String header = request.getHeader(HttpHeaders.ACCEPT_ENCODING);
return (header != null ? header.toLowerCase() : null); return (header != null ? header.toLowerCase(Locale.ROOT) : null);
} }
private String getExtension(String coding) { private String getExtension(String coding) {

View File

@ -318,7 +318,7 @@ public class ResourceHttpRequestHandler extends WebContentGenerator
*/ */
public void setMediaTypes(Map<String, MediaType> mediaTypes) { public void setMediaTypes(Map<String, MediaType> mediaTypes) {
mediaTypes.forEach((ext, mediaType) -> mediaTypes.forEach((ext, mediaType) ->
this.mediaTypes.put(ext.toLowerCase(Locale.ENGLISH), mediaType)); this.mediaTypes.put(ext.toLowerCase(Locale.ROOT), mediaType));
} }
/** /**
@ -708,7 +708,7 @@ public class ResourceHttpRequestHandler extends WebContentGenerator
String filename = resource.getFilename(); String filename = resource.getFilename();
String ext = StringUtils.getFilenameExtension(filename); String ext = StringUtils.getFilenameExtension(filename);
if (ext != null) { if (ext != null) {
mediaType = this.mediaTypes.get(ext.toLowerCase(Locale.ENGLISH)); mediaType = this.mediaTypes.get(ext.toLowerCase(Locale.ROOT));
} }
if (mediaType == null) { if (mediaType == null) {
List<MediaType> mediaTypes = MediaTypeFactory.getMediaTypes(filename); List<MediaType> mediaTypes = MediaTypeFactory.getMediaTypes(filename);

View File

@ -20,6 +20,7 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.Reader; import java.io.Reader;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
@ -417,7 +418,7 @@ public class XsltView extends AbstractUrlBasedView {
} }
if (StringUtils.hasText(encoding)) { if (StringUtils.hasText(encoding)) {
// Only apply encoding if content type is specified but does not contain charset clause already. // Only apply encoding if content type is specified but does not contain charset clause already.
if (contentType != null && !contentType.toLowerCase().contains(WebUtils.CONTENT_TYPE_CHARSET_PREFIX)) { if (contentType != null && !contentType.toLowerCase(Locale.ROOT).contains(WebUtils.CONTENT_TYPE_CHARSET_PREFIX)) {
contentType = contentType + WebUtils.CONTENT_TYPE_CHARSET_PREFIX + encoding; contentType = contentType + WebUtils.CONTENT_TYPE_CHARSET_PREFIX + encoding;
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2022 the original author or authors. * Copyright 2002-2024 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -72,7 +72,7 @@ public class WebSocketExtension {
Assert.hasLength(name, "Extension name must not be empty"); Assert.hasLength(name, "Extension name must not be empty");
this.name = name; this.name = name;
if (!CollectionUtils.isEmpty(parameters)) { if (!CollectionUtils.isEmpty(parameters)) {
Map<String, String> map = new LinkedCaseInsensitiveMap<>(parameters.size(), Locale.ENGLISH); Map<String, String> map = new LinkedCaseInsensitiveMap<>(parameters.size(), Locale.ROOT);
map.putAll(parameters); map.putAll(parameters);
this.parameters = Collections.unmodifiableMap(map); this.parameters = Collections.unmodifiableMap(map);
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2022 the original author or authors. * Copyright 2002-2024 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -42,7 +42,7 @@ public class StandardToWebSocketExtensionAdapter extends WebSocketExtension {
private static Map<String, String> initParameters(Extension extension) { private static Map<String, String> initParameters(Extension extension) {
List<Extension.Parameter> parameters = extension.getParameters(); List<Extension.Parameter> parameters = extension.getParameters();
Map<String, String> result = new LinkedCaseInsensitiveMap<>(parameters.size(), Locale.ENGLISH); Map<String, String> result = new LinkedCaseInsensitiveMap<>(parameters.size(), Locale.ROOT);
for (Extension.Parameter parameter : parameters) { for (Extension.Parameter parameter : parameters) {
result.put(parameter.getName(), parameter.getValue()); result.put(parameter.getName(), parameter.getValue());
} }

View File

@ -203,7 +203,7 @@ public class StandardWebSocketClient extends AbstractWebSocketClient {
private static int getPort(URI uri) { private static int getPort(URI uri) {
if (uri.getPort() == -1) { if (uri.getPort() == -1) {
String scheme = uri.getScheme().toLowerCase(Locale.ENGLISH); String scheme = uri.getScheme().toLowerCase(Locale.ROOT);
return ("wss".equals(scheme) ? 443 : 80); return ("wss".equals(scheme) ? 443 : 80);
} }
return uri.getPort(); return uri.getPort();