Skip to content

Commit 9bcc6ae

Browse files
committed
Apparently the texture can now be http or https, instead of just http
1 parent 71a766c commit 9bcc6ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/global_api/skins/skin_uploader.ex

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ defmodule GlobalApi.SkinUploader do
8383
texture_data = body["data"]["texture"]
8484

8585
texture_id = texture_data["url"]
86-
# http://textures.minecraft.net/texture/ = 38 chars long
87-
texture_id = String.slice(texture_id, 38, String.length(texture_id) - 38)
86+
# can vary now between http and https, so we just grab the last section
87+
texture_id = String.split(texture_id, "/", trim: true) |> List.last()
8888

8989
skin_value = texture_data["value"]
9090
skin_signature = texture_data["signature"]

0 commit comments

Comments
 (0)