From 19c010653a390a1841eeb9162f9745f06b3af08f Mon Sep 17 00:00:00 2001 From: Edwin van den Houdt Date: Fri, 31 Jul 2026 09:35:02 +0200 Subject: [PATCH] test: guard against the /portal redirect dropping the client-facing port Would have caught the previous commit's bug: checks that GET /portal (no trailing slash) 301s and that following the redirect actually lands on a 200 on the same host:port, rather than only checking /portal/ directly. --- scripts/smoke.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/smoke.sh b/scripts/smoke.sh index 8f6d911..6be90d1 100755 --- a/scripts/smoke.sh +++ b/scripts/smoke.sh @@ -56,6 +56,13 @@ HTTP=$(curl -sS -o /dev/null -w '%{http_code}' "$BASE/portal/") check_status "GET /portal/ serves the Angular app" "200" "$HTTP" HTTP=$(curl -sS -o /dev/null -w '%{http_code}' "$BASE/portal/legacy/1001") check_status "deep link /portal/legacy/1001 falls back to index.html" "200" "$HTTP" +# Regression check: nginx's implicit redirect construction uses its own +# internal `listen` port, not the host's published port - a naive +# `return 301 /portal/` silently drops :8080 from the Location header. +BARE_REDIRECT_STATUS=$(curl -sS -o /dev/null -w '%{http_code}' "$BASE/portal") +check_status "GET /portal (no slash) redirects" "301" "$BARE_REDIRECT_STATUS" +FOLLOWED=$(curl -sSL -o /dev/null -w '%{http_code}' "$BASE/portal") +check_status "following that redirect lands on a 200, on the same host:port" "200" "$FOLLOWED" echo "== Seam A: unified read =="