Skip to content

fix(demo): Tier A gets 451 on direct visits too - #31

Merged
M0nsxx merged 1 commit into
mainfrom
fix/demo-tier-a
Nov 27, 2026
Merged

M0nsxx merged 1 commit into
mainfrom
fix/demo-tier-a

Conversation

@Eras256

@Eras256 Eras256 commented Nov 27, 2026

Copy link
Copy Markdown
Member

nirium.xyz blocks Tier A before it rewrites /avalanche to this demo, but the demo's own domains (avalanche.nirium.xyz/avalanche/... and the vercel.app URL) answered anyone. Nirium's Restricted Jurisdictions & Sanctions Policy gives Tier A no access to any Nirium service, paid or free.

  • apps/demo/proxy.ts (Next 16's name for middleware): reads Vercel's x-vercel-ip-country and answers 451 with the same JSON as the site, the node and the markets, on every path.
  • apps/demo/lib/geo.ts: the same nine countries (CU, IR, KP, SY, AF, MM, RU, BY, CN). Unknown country passes (policy §7: geolocation is imperfect). Requests rewritten from nirium.xyz were already checked there.
  • lib/geo.test.ts: the list matches the others; only known Tier A countries are blocked.

Checked locally with next build + next start: /avalanche, /avalanche/explorer and /avalanche/icon.svg answer 451 with the header set to IR or KP, and 200 for MX, US and no header. tsc and npm test pass.

🤖 Generated with Claude Code

nirium.xyz blocks Tier A before it rewrites /avalanche to this demo, but the demo's own domains
(avalanche.nirium.xyz and the vercel.app URL) answered anyone. The policy gives Tier A no access to any
Nirium service, paid or free. proxy.ts reads Vercel's x-vercel-ip-country and answers 451 to the
same nine countries as the site, the node and the markets; unknown passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@M0nsxx M0nsxx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-assisted review (Claude)

Read the diff: apps/demo/proxy.ts reads Vercel's x-vercel-ip-country and returns 451 with the same JSON as the site, node and markets for the nine Tier A countries in lib/geo.ts, and lets unknown countries through. This closes direct visits to the demo domains, which skipped nirium.xyz's check. Tested locally: IR and KP get 451 on /avalanche, /avalanche/explorer and the icon, and MX, US and no header get 200. tsc and 15/15 tests pass. Approve.

@M0nsxx
M0nsxx merged commit 3b4c929 into main Nov 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants