#1: Improve uuidToTextures method, organize tests

This commit is contained in:
ErickSkrauch
2019-04-15 00:31:09 +03:00
parent 7db4d27fba
commit 44f3ee7413
2 changed files with 156 additions and 110 deletions

View File

@@ -55,8 +55,13 @@ func UsernamesToUuids(usernames []string) ([]*ProfileInfo, error) {
return result, nil
}
func UuidToTextures(uuid string) (*SignedTexturesResponse, error) {
request, err := http.NewRequest("GET", "https://sessionserver.mojang.com/session/minecraft/profile/"+uuid, nil)
func UuidToTextures(uuid string, signed bool) (*SignedTexturesResponse, error) {
url := "https://sessionserver.mojang.com/session/minecraft/profile/" + uuid
if signed {
url += "?unsigned=false"
}
request, err := http.NewRequest("GET", url, nil)
if err != nil {
panic(err)
}