Skip to content

Commit

Permalink
Trap for cdn abusers with a specific map/app version (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
biodranik authored Oct 25, 2024
1 parent cbe27cc commit 50c140e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/servers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ 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 https://apps.apple.com/us/app/mapxplorer-navigation-radar/id6463052823
// who abuses 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 50c140e

Please sign in to comment.