mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8241138: http.nonProxyHosts=* causes StringIndexOutOfBoundsException in DefaultProxySelector
Reviewed-by: dfuchs, chegar
This commit is contained in:
parent
a309046028
commit
59af1c2af4
2 changed files with 12 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -385,7 +385,9 @@ public class DefaultProxySelector extends ProxySelector {
|
|||
*/
|
||||
static String disjunctToRegex(String disjunct) {
|
||||
String regex;
|
||||
if (disjunct.startsWith("*") && disjunct.endsWith("*")) {
|
||||
if (disjunct.equals("*")) {
|
||||
regex = ".*";
|
||||
} else if (disjunct.startsWith("*") && disjunct.endsWith("*")) {
|
||||
regex = ".*" + quote(disjunct.substring(1, disjunct.length() - 1)) + ".*";
|
||||
} else if (disjunct.startsWith("*")) {
|
||||
regex = ".*" + quote(disjunct.substring(1));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue