We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9889fd0 commit fe8e673Copy full SHA for fe8e673
src/main/java/com/namelessmc/java_api/NamelessApiBuilder.java
@@ -12,6 +12,7 @@
12
import java.net.Authenticator;
13
import java.net.MalformedURLException;
14
import java.net.ProxySelector;
15
+import java.net.URI;
16
import java.net.URL;
17
import java.net.http.HttpClient;
18
import java.time.Duration;
@@ -41,7 +42,7 @@ public class NamelessApiBuilder {
41
42
NamelessApiBuilder(final @NonNull URL apiUrl,
43
final @NonNull String apiKey) {
44
try {
- this.apiUrl = apiUrl.toString().endsWith("/") ? apiUrl : new URL(apiUrl + "/");
45
+ this.apiUrl = apiUrl.toString().endsWith("/") ? apiUrl : (URI.create(apiUrl + "/").toURL());
46
} catch (MalformedURLException e) {
47
throw new RuntimeException(e);
48
}
0 commit comments