Skip to content

Commit

Permalink
add user agent spoofing
Browse files Browse the repository at this point in the history
  • Loading branch information
MikMik1011 committed Jan 19, 2024
1 parent 3ce2283 commit b183450
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ async function populateMap(force = false) {
for (const station of stations) {
id_uid_map[city][station.id.toString()] = station.uid.toString();
}
console.log(`Populating map finished for ${city}`);
console.info(`Populating map finished for ${city}`);
} catch (err) {
console.log(`Populating map failed for ${city}`);
console.error(`Populating map failed for ${city}`);
console.error(err);
}
}
Expand All @@ -101,8 +101,8 @@ async function getRequest(url, apikey) {
async function postRequest(url, apikey, payload) {
const headers = {
"X-Api-Authentication": apikey,
'User-Agent': 'okhttp/4.10.0'
};

const response = await axios.post(url, payload, { headers, timeout: 5000 });
if (response.status != 200)
throw new Error(`Request failed with status code ${response.status}`);
Expand Down

0 comments on commit b183450

Please sign in to comment.