8294626: Improve URL protocol lower casing

Reviewed-by: dfuchs
This commit is contained in:
Claes Redestad 2022-09-30 16:03:53 +00:00
parent 052a924985
commit 3efbd5f0fa
3 changed files with 22 additions and 11 deletions

View file

@ -1092,7 +1092,7 @@ public abstract class URLConnection {
* @since 9
*/
public static void setDefaultUseCaches(String protocol, boolean defaultVal) {
protocol = protocol.toLowerCase(Locale.US);
protocol = URL.lowerCaseProtocol(protocol);
defaultCaching.put(protocol, defaultVal);
}
@ -1108,7 +1108,7 @@ public abstract class URLConnection {
* @since 9
*/
public static boolean getDefaultUseCaches(String protocol) {
Boolean protoDefault = defaultCaching.get(protocol.toLowerCase(Locale.US));
Boolean protoDefault = defaultCaching.get(URL.lowerCaseProtocol(protocol));
if (protoDefault != null) {
return protoDefault.booleanValue();
} else {