mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8144300: http.nonProxyHosts value having wildcard * both at end and start are not honored
Added validation for wildcard at start and end Reviewed-by: chegar, dfuchs, clanger
This commit is contained in:
parent
d2e4f879b1
commit
cab25623b6
2 changed files with 8 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2018 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
|
||||
|
@ -395,7 +395,9 @@ public class DefaultProxySelector extends ProxySelector {
|
|||
*/
|
||||
static String disjunctToRegex(String disjunct) {
|
||||
String regex;
|
||||
if (disjunct.startsWith("*")) {
|
||||
if (disjunct.startsWith("*") && disjunct.endsWith("*")) {
|
||||
regex = ".*" + quote(disjunct.substring(1, disjunct.length() - 1)) + ".*";
|
||||
} else if (disjunct.startsWith("*")) {
|
||||
regex = ".*" + quote(disjunct.substring(1));
|
||||
} else if (disjunct.endsWith("*")) {
|
||||
regex = quote(disjunct.substring(0, disjunct.length() - 1)) + ".*";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue