From 5e371b2037e7459ef03c834751ca91d19b278e4c Mon Sep 17 00:00:00 2001 From: Sollace Date: Tue, 3 Jul 2018 19:06:14 +0200 Subject: [PATCH] Fixed various bugs with skin uploading --- src/hdskins/java/com/voxelmodpack/hdskins/gui/GuiSkins.java | 1 + .../java/com/voxelmodpack/hdskins/skins/LegacySkinServer.java | 2 +- .../hdskins/upload/ThreadMultipartPostUpload.java | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/gui/GuiSkins.java b/src/hdskins/java/com/voxelmodpack/hdskins/gui/GuiSkins.java index 9fc21247..4d591a9c 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/gui/GuiSkins.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/gui/GuiSkins.java @@ -88,6 +88,7 @@ public class GuiSkins extends GuiScreen implements FutureCallback getData(Session session, MinecraftProfileTexture.Type type, String model, String param, Object val) { return ImmutableMap.of( "user", session.getUsername(), - "uuid", session.getPlayerID(), + "uuid", UUIDTypeAdapter.fromUUID(session.getProfile().getId()), "type", type.toString().toLowerCase(Locale.US), "model", model, param, val); diff --git a/src/hdskins/java/com/voxelmodpack/hdskins/upload/ThreadMultipartPostUpload.java b/src/hdskins/java/com/voxelmodpack/hdskins/upload/ThreadMultipartPostUpload.java index c29e1655..a9d22389 100644 --- a/src/hdskins/java/com/voxelmodpack/hdskins/upload/ThreadMultipartPostUpload.java +++ b/src/hdskins/java/com/voxelmodpack/hdskins/upload/ThreadMultipartPostUpload.java @@ -80,11 +80,13 @@ public class ThreadMultipartPostUpload { if (paramData instanceof Path) { Path uploadPath = (Path) paramData; - outputStream.writeBytes("Content-Disposition: form-data; name=\"" + paramName + "\"; filename=\"" + uploadPath.getFileName() + "\"" + CRLF + CRLF); + outputStream.writeBytes("Content-Disposition: form-data; name=\"" + paramName + "\"; filename=\"" + uploadPath.getFileName() + "\"" + CRLF); + outputStream.writeBytes("Content-Type: image/png" + CRLF + CRLF); Files.copy(uploadPath, outputStream); } else { outputStream.writeBytes("Content-Disposition: form-data; name=\"" + paramName + "\"" + CRLF + CRLF); + outputStream.writeBytes(paramData.toString()); }