Call String.toLowerCase and .toUppercase with explicit locale

Closes gh-42719
This commit is contained in:
Moritz Halbritter
2024-10-17 13:20:15 +02:00
parent 666e0c1a53
commit a3060652f8
25 changed files with 54 additions and 29 deletions

View File

@@ -24,6 +24,7 @@ import java.net.SocketTimeoutException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Base64;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -81,7 +82,7 @@ class Connection {
* @throws Exception in case of errors
*/
void run() throws Exception {
String lowerCaseHeader = this.header.toLowerCase();
String lowerCaseHeader = this.header.toLowerCase(Locale.ROOT);
if (lowerCaseHeader.contains("upgrade: websocket") && lowerCaseHeader.contains("sec-websocket-version: 13")) {
runWebSocket();
}