Skip to content

Commit

Permalink
Trap for cdn abusers with a specific map/app version
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Borsuk <[email protected]>
  • Loading branch information
biodranik committed Oct 24, 2024
1 parent 087cbaf commit 1a23f72
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/servers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ export async function getServersList(request: Request) {
if (dataVersion === null) {
// Older clients download from the archive.
servers = [SERVER.backblaze];
} else if (dataVersion == 240702 && request.headers.get('x-om-appversion') == '1.8.6-4-ios') {
// Redirect unknown bad guys who uses our servers to a slow download "trap" node.
return new Response('["https://cdn-fi2.organicmaps.app/"]', {
headers: { 'Content-Type': 'application/json' },
});
} else {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore workarounds error TS2339: Property 'continent' does not exist on type 'IncomingRequestCfProperties<unknown>'.
Expand Down

0 comments on commit 1a23f72

Please sign in to comment.