Skip to content

Commit

Permalink
Replace String#startsWith with String#charAt
Browse files Browse the repository at this point in the history
  • Loading branch information
chemicL committed Oct 1, 2024
1 parent 89c3512 commit ef1bb0d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private static String parseForwardedPrefix(String prefixHeader) {
prefix.append((endIndex != rawPrefix.length() ? rawPrefix.substring(0, endIndex) : rawPrefix));
}
String parsedPrefix = prefix.toString();
if (!parsedPrefix.isEmpty() && DEFAULT_FORWARDED_HEADER_VALIDATION && !parsedPrefix.startsWith("/")) {
if (!parsedPrefix.isEmpty() && DEFAULT_FORWARDED_HEADER_VALIDATION && parsedPrefix.charAt(0) != '/') {
throw new IllegalArgumentException("X-Forwarded-Prefix did not start with a slash (\"/\"): " + prefixHeader);
}
return parsedPrefix;
Expand Down

0 comments on commit ef1bb0d

Please sign in to comment.