Skip to content

Commit

Permalink
8297569: URLPermission constructor throws IllegalArgumentException: I…
Browse files Browse the repository at this point in the history
…nvalid characters in hostname after JDK-8294378

Backport-of: 2f47f83addd7f69db2c7070552a7ec67bd07d62e
  • Loading branch information
GoeLin committed Jan 16, 2023
1 parent 8458368 commit 71e89e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/java.base/share/classes/java/net/URLPermission.java
Expand Up @@ -467,7 +467,7 @@ private void parseURI(String url) {
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() {
Expand Down
4 changes: 3 additions & 1 deletion test/jdk/java/net/URLPermission/URLPermissionTest.java
Expand Up @@ -395,7 +395,9 @@ static URLEqualityTest eqtest(String arg1, String arg2, boolean expected) {
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;
Expand Down

1 comment on commit 71e89e1

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.