add 403 to expected response codes

This commit is contained in:
jomo 2020-03-28 23:37:08 +01:00
parent 5eb5b6fa5e
commit ea1ae64283

View File

@ -6,7 +6,7 @@ var skins = require("./skins");
require("./object-patch");
var session_url = "https://sessionserver.mojang.com/session/minecraft/profile/";
var textures_url = "http://textures.minecraft.net/texture/";
var textures_url = "https://textures.minecraft.net/texture/";
var exp = {};
@ -28,7 +28,7 @@ exp.get_from_options = function(rid, url, options, callback) {
// log url + code + description
var code = response && response.statusCode;
var logfunc = code && code < 405 ? logging.debug : logging.warn;
var logfunc = code && (code < 400 || code === 404) ? logging.debug : logging.warn;
logfunc(rid, url, code || error && error.code, http_code[code]);
// not necessarily used
@ -49,6 +49,7 @@ exp.get_from_options = function(rid, url, options, callback) {
// can be cached as null
body = null;
break;
case 403: // Blocked by CloudFront :(
case 429: // this shouldn't usually happen, but occasionally does
case 500:
case 502: // CloudFront can't reach mojang origin