Skip to content

Commit

Permalink
HttpURI toURI passes all info
Browse files Browse the repository at this point in the history
Fix #11465 and #7750
HttpURI.toURI user and fragment are retained.
Use to URI(String) constructor, as all URI constructors will parse the URI anyway.
  • Loading branch information
gregw committed Feb 29, 2024
1 parent fe7e421 commit 3e2ec04
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import java.io.Serial;
import java.io.Serializable;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
Expand Down Expand Up @@ -262,14 +261,7 @@ default boolean hasUtf16Encoding()

default URI toURI()
{
try
{
return new URI(toString());
}
catch (URISyntaxException x)
{
throw new RuntimeException(x);
}
return URI.create(toString());
}

class Immutable implements HttpURI, Serializable
Expand Down

0 comments on commit 3e2ec04

Please sign in to comment.