Allow underscore in proxy hostnames
Some proxies use underscore and we should allow configuring them Change-Id: I6b4eeac7d486ff1eb10cc14cee5ef36db0f9e278
This commit is contained in:
@@ -58,12 +58,16 @@ public class ProxySelector extends Fragment implements DialogCreatable {
|
|||||||
Button mClearButton;
|
Button mClearButton;
|
||||||
Button mDefaultButton;
|
Button mDefaultButton;
|
||||||
|
|
||||||
|
// Allows underscore char to supports proxies that do not
|
||||||
|
// follow the spec
|
||||||
|
private static final String HC = "a-zA-Z0-9\\_";
|
||||||
|
|
||||||
// Matches blank input, ips, and domain names
|
// Matches blank input, ips, and domain names
|
||||||
private static final String HOSTNAME_REGEXP =
|
private static final String HOSTNAME_REGEXP =
|
||||||
"^$|^[a-zA-Z0-9]+(\\-[a-zA-Z0-9]+)*(\\.[a-zA-Z0-9]+(\\-[a-zA-Z0-9]+)*)*$";
|
"^$|^[" + HC + "]+(\\-[" + HC + "]+)*(\\.[" + HC + "]+(\\-[" + HC + "]+)*)*$";
|
||||||
private static final Pattern HOSTNAME_PATTERN;
|
private static final Pattern HOSTNAME_PATTERN;
|
||||||
private static final String EXCLUSION_REGEXP =
|
private static final String EXCLUSION_REGEXP =
|
||||||
"$|^[a-zA-Z0-9]+(\\-[a-zA-Z0-9]+)*(\\.[a-zA-Z0-9]+(\\-[a-zA-Z0-9]+)*)*$";
|
"$|^[" + HC + "]+(\\-[" + HC + "]+)*(\\.[" + HC + "]+(\\-[" + HC + "]+)*)*$";
|
||||||
private static final Pattern EXCLUSION_PATTERN;
|
private static final Pattern EXCLUSION_PATTERN;
|
||||||
static {
|
static {
|
||||||
HOSTNAME_PATTERN = Pattern.compile(HOSTNAME_REGEXP);
|
HOSTNAME_PATTERN = Pattern.compile(HOSTNAME_REGEXP);
|
||||||
|
Reference in New Issue
Block a user