From 005902cab32ec9ae66f857fc542fba7a95ddf884 Mon Sep 17 00:00:00 2001 From: ibratabian17 Date: Wed, 11 Sep 2024 22:50:18 +0800 Subject: [PATCH] Use Proper Headers --- core/route/account.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/core/route/account.js b/core/route/account.js index a609098..70adf78 100644 --- a/core/route/account.js +++ b/core/route/account.js @@ -168,15 +168,12 @@ exports.initroute = (app) => { // If the profile is not found locally, fetch from external source console.error(`[ACC] Asking Official Server For: `, profileId); const url = `https://prod.just-dance.com/profile/v2/profiles?profileIds=${encodeURIComponent(profileId)}`; + // Modify headers by omitting the Host header + const headers = { ...req.headers }; + delete headers.host; try { const profileResponse = await axios.get(url, { - headers: { - 'User-Agent': req.headers['user-agent'], - 'Accept': req.headers['accept'] || '*/*', - 'Accept-Language': req.headers['accept-language'] || 'en-us,en', - 'Authorization': ticket, - 'X-SkuId': req.headers['x-skuid'], - } + headers }); // Assume the external response contains the profile as `profileData`