SuperMinor Fixes (надеюсь последние для аккаунтов)

This commit is contained in:
Sashegdev
2026-04-08 20:04:52 +00:00
parent 8733e359e6
commit cca6ef3eca
@@ -150,21 +150,17 @@ public class AuthManager {
private static HttpResponse<String> post(String endpoint, String jsonBody) throws Exception { private static HttpResponse<String> post(String endpoint, String jsonBody) throws Exception {
String fullUrl = ZHttpClient.getBaseUrl() + endpoint; String fullUrl = ZHttpClient.getBaseUrl() + endpoint;
HttpRequest req = HttpRequest.newBuilder() HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create(fullUrl)) .uri(URI.create(fullUrl))
.header("Content-Type", "application/json; charset=utf-8") .header("Content-Type", "application/json; charset=utf-8")
.header("Accept", "application/json") .header("Accept", "application/json")
.header("User-Agent", "ZernMC-Launcher/1.0") .header("User-Agent", "ZernMC-Launcher/1.0")
.header("Connection", "close") // .header("Connection", "close")
.timeout(Duration.ofSeconds(15)) .timeout(Duration.ofSeconds(15))
.POST(HttpRequest.BodyPublishers.ofString(jsonBody, StandardCharsets.UTF_8)) .POST(HttpRequest.BodyPublishers.ofString(jsonBody, StandardCharsets.UTF_8))
.build(); .build();
// Логируем для отладки
System.out.println(ZAnsi.cyan("[HTTP] → POST " + fullUrl));
System.out.println(ZAnsi.cyan("[HTTP] Body: " + jsonBody));
return HTTP.send(req, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)); return HTTP.send(req, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));
} }