From e8889d91605d9b3c32d2307f49f0aa9f3bdc18b6 Mon Sep 17 00:00:00 2001 From: AlexProgrammerDE <40795980+AlexProgrammerDE@users.noreply.github.com> Date: Thu, 18 Jul 2024 11:05:07 +0200 Subject: [PATCH] Fix join requests --- .../org/geysermc/mcprotocollib/auth/util/HTTPUtils.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/protocol/src/main/java/org/geysermc/mcprotocollib/auth/util/HTTPUtils.java b/protocol/src/main/java/org/geysermc/mcprotocollib/auth/util/HTTPUtils.java index 8781c69b4..d21e3a51a 100644 --- a/protocol/src/main/java/org/geysermc/mcprotocollib/auth/util/HTTPUtils.java +++ b/protocol/src/main/java/org/geysermc/mcprotocollib/auth/util/HTTPUtils.java @@ -36,8 +36,11 @@ public static T makeRequest(@Nullable ProxyInfo proxy, URI uri, Object input throw new IllegalArgumentException("URI cannot be null."); } - HttpResponse response = createHttpClient(proxy).execute(input == null ? new HttpRequest("GET", uri.toURL()) : - new HttpContentRequest("POST", uri.toURL()).setContent(HttpContent.string(GSON.toJson(input)))); + HttpResponse response = createHttpClient(proxy) + .execute(input == null ? new HttpRequest("GET", uri.toURL()) : + new HttpContentRequest("POST", uri.toURL()) + .setContent(HttpContent.string(GSON.toJson(input))) + .setHeader(Headers.CONTENT_TYPE, ContentTypes.APPLICATION_JSON.toString())); if (responseType == null) { return null;