1
0
mirror of https://github.com/elyby/chrly.git synced 2025-01-12 14:52:34 +05:30

Исправлена ошибка, когда к скинам моянга приклеивался наш домен

This commit is contained in:
ErickSkrauch 2016-07-29 01:20:09 +03:00
parent 64bf7deb79
commit c03021403a
2 changed files with 3 additions and 2 deletions

@ -16,7 +16,6 @@ func Skin(w http.ResponseWriter, r *http.Request) {
rec, err := data.FindRecord(username)
if (err != nil) {
http.Redirect(w, r, "http://skins.minecraft.net/MinecraftSkins/" + username + ".png", 301)
log.Println("Cannot get skin for username " + username)
return
}

@ -19,11 +19,13 @@ func Textures(w http.ResponseWriter, r *http.Request) {
if (err != nil || rec.SkinId == 0) {
rec.Url = "http://skins.minecraft.net/MinecraftSkins/" + username + ".png"
rec.Hash = string(tools.BuildNonElyTexturesHash(username))
} else {
rec.Url = tools.BuildElyUrl(rec.Url)
}
textures := data.TexturesResponse{
Skin: &data.Skin{
Url: tools.BuildElyUrl(rec.Url),
Url: rec.Url,
Hash: rec.Hash,
},
}