Fix downloading Parchment
All checks were successful
Publish to snapshot maven / build (push) Successful in 22s

This commit is contained in:
TheKodeToad 2024-09-04 14:22:44 +01:00
parent bc47d9cc1a
commit 5ce38092c6
No known key found for this signature in database
GPG key ID: 5E39D70B4C93C38E
2 changed files with 3 additions and 2 deletions

View file

@ -8,7 +8,7 @@ plugins {
} }
group = "dev.frogmc" group = "dev.frogmc"
version = "0.0.1-alpha.15" version = "0.0.1-alpha.16"
repositories { repositories {
mavenCentral() mavenCentral()

View file

@ -5,6 +5,7 @@ import java.net.URI;
import java.net.http.HttpClient; import java.net.http.HttpClient;
import java.net.http.HttpRequest; import java.net.http.HttpRequest;
import java.net.http.HttpResponse; import java.net.http.HttpResponse;
import java.net.http.HttpClient.Redirect;
import java.nio.file.Path; import java.nio.file.Path;
import com.electronwill.nightconfig.core.UnmodifiableConfig; import com.electronwill.nightconfig.core.UnmodifiableConfig;
@ -28,7 +29,7 @@ public class HttpHelper {
} }
private static <T> HttpResponse<T> request(String url, HttpResponse.BodyHandler<T> handler) throws IOException { private static <T> HttpResponse<T> request(String url, HttpResponse.BodyHandler<T> handler) throws IOException {
try (HttpClient client = HttpClient.newHttpClient()) { try (HttpClient client = HttpClient.newBuilder().followRedirects(Redirect.NORMAL).build()) {
HttpRequest request = HttpRequest.newBuilder() HttpRequest request = HttpRequest.newBuilder()
.header("User-Agent", Constants.USER_AGENT) .header("User-Agent", Constants.USER_AGENT)
.header("Accept", "*/*") .header("Accept", "*/*")