mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-21 23:41:18 +01:00
Resolve mismatched URL #s, closes #85, gg @jomo
This commit is contained in:
parent
021c73c79d
commit
e73e677d8d
@ -86,6 +86,7 @@ exp.get_from = function(rid, url, callback) {
|
|||||||
// the skin url is taken from the HTTP redirect
|
// the skin url is taken from the HTTP redirect
|
||||||
// type reference is above
|
// type reference is above
|
||||||
exp.get_username_url = function(rid, name, type, callback) {
|
exp.get_username_url = function(rid, name, type, callback) {
|
||||||
|
console.log(mojang_urls[type])
|
||||||
exp.get_from(rid, mojang_urls[type] + name + ".png", function(body, response, err) {
|
exp.get_from(rid, mojang_urls[type] + name + ".png", function(body, response, err) {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
callback(err, response ? (response.statusCode === 404 ? null : response.headers.location) : null);
|
callback(err, response ? (response.statusCode === 404 ? null : response.headers.location) : null);
|
||||||
@ -99,9 +100,9 @@ exp.get_username_url = function(rid, name, type, callback) {
|
|||||||
// +type+ specifies which to retrieve
|
// +type+ specifies which to retrieve
|
||||||
exp.get_uuid_url = function(profile, type, callback) {
|
exp.get_uuid_url = function(profile, type, callback) {
|
||||||
var url = null;
|
var url = null;
|
||||||
if (type === 1) {
|
if (type === 0) {
|
||||||
url = exp.extract_skin_url(profile);
|
url = exp.extract_skin_url(profile);
|
||||||
} else if (type === 2) {
|
} else if (type === 1) {
|
||||||
url = exp.extract_cape_url(profile);
|
url = exp.extract_cape_url(profile);
|
||||||
}
|
}
|
||||||
callback(url || null);
|
callback(url || null);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user