diff --git a/src/middleware/arns.ts b/src/middleware/arns.ts index d537bba9..e51d4476 100644 --- a/src/middleware/arns.ts +++ b/src/middleware/arns.ts @@ -40,7 +40,7 @@ export const createArnsMiddleware = ({ next(); return; } - const arnsSubdomain = req.subdomains[config.ROOT_HOST_SUBDOMAIN_LENGTH - 1]; + const arnsSubdomain = req.subdomains[req.subdomains.length - 1]; if ( EXCLUDED_SUBDOMAINS.has(arnsSubdomain) || // Avoid collisions with sandbox URLs by ensuring the subdomain length