8297569: URLPermission constructor throws IllegalArgumentException: Invalid characters in hostname after JDK-8294378
Reviewed-by: dfuchs
This commit is contained in:
parent
87d1097d9b
commit
2f47f83add
@ -149,9 +149,6 @@ class HostPortrange {
|
||||
// regular domain name
|
||||
hoststr = toLowerCase(hoststr);
|
||||
}
|
||||
} else {
|
||||
// regular domain name
|
||||
hoststr = toLowerCase(hoststr);
|
||||
}
|
||||
}
|
||||
hostname = hoststr;
|
||||
|
@ -494,7 +494,7 @@ public final class URLPermission extends Permission {
|
||||
auth = authpath.substring(0, delim);
|
||||
this.path = authpath.substring(delim);
|
||||
}
|
||||
this.authority = new Authority(scheme, auth);
|
||||
this.authority = new Authority(scheme, auth.toLowerCase(Locale.ROOT));
|
||||
}
|
||||
|
||||
private String actions() {
|
||||
|
@ -402,7 +402,9 @@ public class URLPermissionTest {
|
||||
static Test[] createTests = {
|
||||
createtest("http://user@foo.com/a/b/c"),
|
||||
createtest("http://user:pass@foo.com/a/b/c"),
|
||||
createtest("http://user:@foo.com/a/b/c")
|
||||
createtest("http://user:@foo.com/a/b/c"),
|
||||
createtest("http://foo_bar"),
|
||||
createtest("http://foo_bar:12345")
|
||||
};
|
||||
|
||||
static boolean failed = false;
|
||||
|
Loading…
Reference in New Issue
Block a user