Description
Tracciatore di redirect chain HTTP — segue ogni hop manualmente (NO follow automatico) e restituisce array completo di redirect con status code, Location header, latency, body bytes (HEAD-mode default), URL finale. Rileva loop circolari, redirect cross-protocol (http→https), redirect cross-domain, e flag catene "troppo lunghe" (>3 hop) per impatto SEO link juice. Differenza con i sibling: action_redirect_chain = traccia chain HTTP (URL → array hops). Per audit broken links su pagina HTML usa action_link_audit. Per parsing meta tag dopo aver risolto il redirect finale usa action_meta_extract. Per fetch HTML auto-follow (per scraping) usa action_web_fetch_advanced. Status codes gestiti: 301 Permanent (canonical SEO juice transfer), 302 Found (temporary — no SEO transfer), 303 See Other (POST → GET conversion), 307/308 (method preservation), Refresh meta tag (HTML `<meta http-equiv="refresh">`) estratto se presente (browser segue, crawler ignora — flag come "weak redirect"). Detection canonical mismatch: URL finale != og:url / canonical = red flag SEO. Output: `{ chain: [{ url, status, location, latencyMs, server, contentType }], finalUrl, hopCount, loopDetected, crossDomainCount, totalLatencyMs, seoImpact: "good"|"warning"|"bad" }`. seoImpact deterministico: good (1-2 hop), warning (3-4 hop o cross-domain), bad (5+ hop o loop). Use case Cappella-Sistina-grade: (1) **audit post-migrazione sito** — fetch sitemap vecchia, per ogni URL → redirect_chain → verify che redirige a URL nuova in 1 hop con 301 (no juice loss). Alert se 302 (settato per sbaglio); (2) **vanity URL verifier** — bit.ly/short.io/custom domain — segui chain fino al final URL per detection malicious redirect (advertiser frode); (3) **canonical URL audit propri prodotti** — il canonical e\` raggiungibile in 1 hop? O passa per 3 redirect? Google CMM penalizza chain > 3; (4) **debug cookie-redirect login flow** — per debug SSO flow custom, tracci ogni 302 con il cookie state passato. Safety budget: SSRF guard via @flowforge/safe-fetch (no fetch a 127/10/192/ link-local), timeout 8s per hop, max 20 hop totali (oltre → loop break), audit log con startUrl + finalUrl + hopCount per SEO traceability.
