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.
This commit is contained in:
eho
2026-07-31 09:35:02 +02:00
parent 46926215af
commit 19c010653a
+7
View File
@@ -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" check_status "GET /portal/ serves the Angular app" "200" "$HTTP"
HTTP=$(curl -sS -o /dev/null -w '%{http_code}' "$BASE/portal/legacy/1001") 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" 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 ==" echo "== Seam A: unified read =="