From 1753385d6bb70300494ad30a5aaddc4531fe93fc Mon Sep 17 00:00:00 2001 From: AGMASO Date: Tue, 23 Jun 2026 13:40:48 +0200 Subject: [PATCH] fix(compliance): add trailing slash to preflight-compliance fetch The app sets `trailingSlash: true` in next.config.js, so requests to `/api/preflight-compliance` (without a trailing slash) get a 308 redirect to the slashed path. Combined with the cached permanent redirect this loops in the browser and surfaces as ERR_TOO_MANY_REDIRECTS, breaking the compliance gate. Call the canonical slashed path to avoid the redirect. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/hooks/compliance/service-compliance.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hooks/compliance/service-compliance.ts b/src/hooks/compliance/service-compliance.ts index e92bca3ddf..8cd49b633c 100644 --- a/src/hooks/compliance/service-compliance.ts +++ b/src/hooks/compliance/service-compliance.ts @@ -11,7 +11,9 @@ export type ComplianceCheckResponse = { export const checkCompliance = async (address: string): Promise => { try { - const res = await fetch(`/api/preflight-compliance?address=${encodeURIComponent(address)}`); + // NOTE: trailing slash is required because next.config.js sets `trailingSlash: true`. + // Without it Next issues a 308 redirect that loops -> ERR_TOO_MANY_REDIRECTS. + const res = await fetch(`/api/preflight-compliance/?address=${encodeURIComponent(address)}`); const data = await res.json(); if (res.ok) {