mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-22 07:51:17 +01:00
set User-Agent to 'https://crafatar.com'
This commit is contained in:
parent
30fabeac8c
commit
96ae65ee6a
@ -28,6 +28,9 @@ function extract_skin_url(profile) {
|
|||||||
var get_username_url = function(name, callback) {
|
var get_username_url = function(name, callback) {
|
||||||
request.get({
|
request.get({
|
||||||
url: skins_url + name + ".png",
|
url: skins_url + name + ".png",
|
||||||
|
headers: {
|
||||||
|
"User-Agent": "https://crafatar.com"
|
||||||
|
},
|
||||||
timeout: config.http_timeout,
|
timeout: config.http_timeout,
|
||||||
followRedirect: false
|
followRedirect: false
|
||||||
}, function(error, response, body) {
|
}, function(error, response, body) {
|
||||||
@ -59,6 +62,9 @@ var get_username_url = function(name, callback) {
|
|||||||
var get_uuid_url = function(uuid, callback) {
|
var get_uuid_url = function(uuid, callback) {
|
||||||
request.get({
|
request.get({
|
||||||
url: session_url + uuid,
|
url: session_url + uuid,
|
||||||
|
headers: {
|
||||||
|
"User-Agent": "https://crafatar.com"
|
||||||
|
},
|
||||||
timeout: config.http_timeout // ms
|
timeout: config.http_timeout // ms
|
||||||
}, function (error, response, body) {
|
}, function (error, response, body) {
|
||||||
if (!error && response.statusCode == 200) {
|
if (!error && response.statusCode == 200) {
|
||||||
@ -103,6 +109,9 @@ exp.get_skin_url = function(uuid, callback) {
|
|||||||
exp.get_skin = function(url, callback) {
|
exp.get_skin = function(url, callback) {
|
||||||
request.get({
|
request.get({
|
||||||
url: url,
|
url: url,
|
||||||
|
headers: {
|
||||||
|
"User-Agent": "https://crafatar.com"
|
||||||
|
},
|
||||||
encoding: null, // encoding must be null so we get a buffer
|
encoding: null, // encoding must be null so we get a buffer
|
||||||
timeout: config.http_timeout // ms
|
timeout: config.http_timeout // ms
|
||||||
}, function (error, response, body) {
|
}, function (error, response, body) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user