Skip to content

Commit

Permalink
fix: remove cf check
Browse files Browse the repository at this point in the history
  • Loading branch information
sruusk committed Jan 12, 2025
1 parent 8400bf5 commit 45dcd0a
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ export async function getPlayer(
const originResponse = await hero.goto(origin, { timeoutMs: this.timeout });
const { statusCode } = originResponse.response;
if (statusCode !== 200) {
// Check for cloudflare challenge
const title = hero.document.querySelector('title');
if (title !== undefined && (await title.textContent) === 'Attention Required! | Cloudflare') {
throw new Error(`play.esea.net returned a non-200 response: ${statusCode}
Received cloudflare challenge. This is likely caused by an untrusted IP.`);
}
// noinspection ExceptionCaughtLocallyJS
throw new Error(`play.esea.net returned a non-200 response: ${statusCode}`);
}
Expand Down Expand Up @@ -164,12 +158,6 @@ export async function getPlayerFromSteamId64(
const originResponse = await hero.goto(origin, { timeoutMs: this.timeout });
const { statusCode } = originResponse.response;
if (statusCode !== 200) {
// Check for cloudflare challenge
const title = hero.document.querySelector('title');
if (title && (await title.textContent) === 'Attention Required! | Cloudflare') {
throw new Error(`play.esea.net returned a non-200 response: ${statusCode}
Received cloudflare challenge. This is likely caused by an untrusted IP.`);
}
// noinspection ExceptionCaughtLocallyJS
throw new Error(`play.esea.net returned a non-200 response: ${statusCode}`);
}
Expand Down

0 comments on commit 45dcd0a

Please sign in to comment.