🐛 Forward Strava _strava_idcf cookie and retry on 401 #8
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/forward-strava-idcf"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Strava's identified tile endpoint now also requires the
_strava_idcfJWT (short-lived, athlete-bound) alongside the CloudFront trio — trio-only requests get 401. That JWT is emitted as aSet-Cookieby the very exchange responsefetch_cookiesalready parses; we were dropping it. This captures and forwards it, and teaches the cookie-recovery path the 401 signature (the 403-only trigger couldn't recover an idcf that expires or is invalidated inside the 12 h refresh window).Evidence
content-a.strava.com/identified/…returns 401 for trio-only and 200 PNG for trio +_strava_idcf→ every zoom 12–15 request through canicule was a 502.cargo test -p canicule— 44 passed (9 suites), incl. new:forwards_the_strava_idcf_cookie_on_authenticated_tile_requests— exact wire-level Cookie-header assertion (red against pre-fix code)reauthenticates_after_an_upstream_401_when_the_idcf_cookie_is_missing— mock tile endpoint returns 401 unless the Cookie header carries_strava_idcf=; asserts final 200 through refresh+refetch (red was 502 vs 200, the production shape)"; "cargo fmt --checkandclippy --all-targetsclean.Merge Danger
Door: two-way — revert restores current (hi-res-broken) behaviour; anonymous zoom ≤ 11 unaffected either way.
Blast Radius: low — authenticated tile path only. Absent-idcf behaviour is byte-identical to today's, pinned by tests. No leak path: the idcf value only flows into the upstream request; visitor responses carry tile bytes only. Post-deploy check: one zoom 12–15 tile through the proxy after the next tofu-maison apply (Renovate bumps the pinned ref automatically).
Related: findings also posted on #6 — the login/password flow must maintain
_strava4_sessionand_strava_idcf.WIP: 🐛 Forward Strava _strava_idcf cookie and retry on 401to 🐛 Forward Strava _strava_idcf cookie and retry on 401