From ca8a0a11618ad08dd08463abed27c9f829641261 Mon Sep 17 00:00:00 2001 From: StartsMercury <89975834+StartsMercury@users.noreply.github.com> Date: Fri, 17 Jan 2025 13:32:48 +0800 Subject: [PATCH] Update QuiltBasePath.java: update URI conversion (#462) --- .../loader/impl/filesystem/QuiltBasePath.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/quiltmc/loader/impl/filesystem/QuiltBasePath.java b/src/main/java/org/quiltmc/loader/impl/filesystem/QuiltBasePath.java index fc46e450e..d45ae2aa7 100644 --- a/src/main/java/org/quiltmc/loader/impl/filesystem/QuiltBasePath.java +++ b/src/main/java/org/quiltmc/loader/impl/filesystem/QuiltBasePath.java @@ -554,9 +554,17 @@ public URI toUri() { return toAbsolutePath().toUri(); } try { - // Passing as one string ensures that Java goes ahead and normalizes everything for us + // Constructing as components ensures proper quoting on most // Adding the port stores the important info in both the authority and host - return new URI(fs.provider().getScheme() + "://" + fs.name + ":0" + this); + return new URI( + fs.provider().getScheme(), + null, + fs.name, + 0, + this.toString(), + null, + null + ).normalize(); } catch (URISyntaxException e) { throw new RuntimeException(e); }