Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8297569

URLPermission constructor throws IllegalArgumentException: Invalid characters in hostname after JDK-8294378

XMLWordPrintable

    • b26
    • Verified

        The code in java.net.URLPermission was recently changed to fix the issue noted in https://bugs.openjdk.org/browse/JDK-8294378. After that change, the following code now throws an exception:

        new URLPermission("https://foo_bar:12345/")

        fails with:

        | Exception java.lang.IllegalArgumentException: Invalid characters in hostname
        | at HostPortrange.toLowerCase (HostPortrange.java:192)
        | at HostPortrange.<init> (HostPortrange.java:154)
        | at URLPermission$Authority.<init> (URLPermission.java:529)
        | at URLPermission.parseURI (URLPermission.java:497)
        | at URLPermission.init (URLPermission.java:206)
        | at URLPermission.<init> (URLPermission.java:186)
        | at URLPermission.<init> (URLPermission.java:243)
        | at (#1:1)

              jpai Jaikiran Pai
              jpai Jaikiran Pai
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: