Merge branch 'master' of github.com:crafatar/crafatar

This commit is contained in:
jomo 2015-03-22 03:09:12 +01:00
commit 2cb197a717
5 changed files with 8 additions and 8 deletions

View File

@ -69,7 +69,7 @@ module.exports = function(req, res) {
logging.debug(rid, "matches:", matches); logging.debug(rid, "matches:", matches);
sendimage(rid, http_status, status, image); sendimage(rid, http_status, status, image);
} else { } else {
handle_default(rid, 404, status, userId); handle_default(rid, 200, status, userId);
} }
}); });
} catch(e) { } catch(e) {

View File

@ -85,7 +85,7 @@ module.exports = function(req, res) {
sendimage(rid, http_status, status, image); sendimage(rid, http_status, status, image);
} else { } else {
logging.log(rid, "image not found, using default."); logging.log(rid, "image not found, using default.");
handle_default(rid, 404, status, userId); handle_default(rid, 200, status, userId);
} }
}); });
} catch(e) { } catch(e) {

View File

@ -43,7 +43,7 @@ module.exports = function(req, res) {
logging.debug(rid, "matches:", matches); logging.debug(rid, "matches:", matches);
sendimage(rid, http_status, image); sendimage(rid, http_status, image);
} else { } else {
handle_default(rid, 404, userId); handle_default(rid, 200, userId);
} }
}); });
} catch(e) { } catch(e) {

View File

@ -311,9 +311,9 @@ describe("Crafatar", function() {
for (l in locations) { for (l in locations) {
var location = locations[l]; var location = locations[l];
(function(location) { (function(location) {
it("should return a 404 (default steve image " + location + ")", function(done) { it("should return a 200 (default steve image " + location + ")", function(done) {
request.get("http://localhost:3000/" + location + "/invalidjsvns?default=steve", function(error, res, body) { request.get("http://localhost:3000/" + location + "/invalidjsvns?default=steve", function(error, res, body) {
assert.equal(404, res.statusCode); assert.equal(200, res.statusCode);
done(); done();
}); });
}); });

View File

@ -65,7 +65,7 @@ block content
| The standard value is calculated based on the UUID (even = alex, odd = steve).<br> | The standard value is calculated based on the UUID (even = alex, odd = steve).<br>
| Usernames always default to steve. | Usernames always default to steve.
td td
| The image to be served when the userid has no skin (404).<br> | The image to be served when the userid has no skin.<br>
| Valid options are | Valid options are
a(href="/avatars/0?default=steve") steve a(href="/avatars/0?default=steve") steve
| , | ,
@ -198,7 +198,7 @@ block content
| The standard value is calculated based on the UUID (even = alex, odd = steve).<br> | The standard value is calculated based on the UUID (even = alex, odd = steve).<br>
| Usernames always default to steve. | Usernames always default to steve.
td td
| The image to be served when the userid has no skin (404).<br> | The image to be served when the userid has no skin.<br>
| Valid options are | Valid options are
a(href="/skins/0?default=steve") steve a(href="/skins/0?default=steve") steve
| , | ,
@ -229,7 +229,7 @@ block content
| Replace | Replace
mark.green userid mark.green userid
| with a Mojang <b>UUID</b> or <b>username</b> to get the related cape.<br> | with a Mojang <b>UUID</b> or <b>username</b> to get the related cape.<br>
| The user's cape is returned, otherwise a 404 is thrown.<br> | The user's cape is returned, otherwise a 404 is returned.<br>
.code .code
| #{domain}/capes/ | #{domain}/capes/
mark.green userid mark.green userid